TOGoS writes:
> I0  Prototyped return?
> I1  Number of overflow return values
> I2  Number of return values in PMC registers
> P3  Overflow return values in an array PMC
> 
> so as to make call/return symmetrical
> (this would also allow me to use the same
> Params class in my compiler for both
> calls and returns ;-)

This is brilliant!  And it's not because you can re-use your Params
class.  It's because call context falls right out of the calling
conventions.

Provided that we have a way to attach signature information to a PMC
(which would be pretty nice, I suspect), then the signature of P1 is the
context of the call.  And now we don't have to pass in context
information seperately.

And if you feel like fooling with continuations; i.e. putting somebody
else's return continuation in P1, the context will work out correctly
there, too.

Actually, attaching dynamic signature information to various kinds of
.Subs seems to have a lot of advantages.  It makes cross-language
calling easier, because the caller has an idea about what the callee
wants.  For instance:

    my &pysub := get_some_python_sub();
    for @a, &pysub;

Would take appropriate chunks of @a, depending on how many parameters
&pysub wanted.  Or &pysub could be from any language, maybe not even
known by the program, and this would still work correctly.

Of course, there may be some big issues that I'm missing.

Luke



> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com

Reply via email to