On Sep-15, Leopold Toetsch wrote:
> Steve Fink <[EMAIL PROTECTED]> wrote:
> > I'm not sure how to use the current pdd03's calling conventions to
> > implement what I want right now. Let's consider Perl6:
> 
> First, that whole stuff definitely needs more clarification. Calling and
> return conventions are not symmetrical, C<I1> (number of items in C<P3>)
> is redundant... And we probably need pdd03-examples.pod.
> 
> >   sub f ($a, $b) { ... }
> >   f(1, 2);
> >   &f(1, 2);
> 
> >   I0 = 1 # have prototype
> >   I5 = 1
> >   I6 = 2
> 
> As the sub doesn't specify taking C<int>, arguments would go into P5 and
> P6.

Uh, right. I think I meant sub f (int $a, int $b) { ... }. But you get
the point.

> > It would be tempting to change all pushtop,pushbottom,poptop,popbottom
> > ops into ones that had the start register and number of registers as
> > arguments.
> 
> No. These ops are used to save registers for the caller and not for
> argument passing.

Yes, I know -- but if we made the suggested change, then they could be
used for both. (Only when needed -- normally, they'd just be used for
caller-save stuff, it's only in complicated situations where we'd use
them for dynamic register numbering.)

> >  sub f($a, $b, $c, $d) { ... }
> >  f(1, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], @array);
> 
> I would at least expect a compiler warning: "Suboptimal argument passing
> detected in function call ...".

This sounds like the beginning of a whole set of things like "Warning
#238: suboptimal implementation of xxx. Are you sure you know what you
are doing?"

Reply via email to