On Monday 03 September 2001 09:30 pm, Dan Sugalski wrote:
> A clever idea, and one I'd not though of. That's probably the best way to
> do it. Has some other issues, like do we allow prototypes like:
>
>    sub foo ($$) {};
>
> to be called as:
>
>    foo(@bar)
>
> if @bar has two elements in it?

To me, that seems only a language decision.  This could certainly handle 
that.  The internals problem is figuring out how to signify all the 
different variations you could allow.  :-) (And how they could affect what 
is being passed in.)

For instance, I knew the autoreferencing of an array with a (\@) prototype 
was a bust (as in Perl 5).  But, IIRC, Perl 6 is passing everything by 
reference, with the user explicitly flattening any lists.  You can always go 
from references to lists, just not the other way around, so this still works.

There are a couple of other prototype tricks that we'd have to work out...
Unseparated bare code blocks for (&) prototypes come to mind.  

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to