PCC and playing with arguments from C

Wim Lewis wiml at hhhh.org
Sun Apr 5 22:26:51 UTC 2009


On Apr 5, 2009, at 2:27 PM, Allison Randal wrote:
> That said, does currying necessarily need to use the 'invoke'  
> vtable function? I understand that at the language level it should  
> look like invoking the sub with too few arguments returns a new  
> sub, but there's an extra layer of abstraction here. At the PIR or  
> C level, currying could be implemented as a method on the sub  
> object, which the internals of the high-level language call  
> directly when currying is needed. That might actually lead to a  
> cleaner implementation than mixing up currying and invocation  
> within 'invoke'.

In some cases you might want / be able to partially evaluate a  
curried function, producing in effect a sub that's specialized to a  
certain set of arguments. I don't know if one approach or the other  
would make this harder, but I think it's worth considering it as  
something that an implementor might want to be able to do.

(Actually I think the approach you describe would make partial  
evaluation easier to implement, but I haven't thought about it too  
much.)




More information about the parrot-dev mailing list