[EMAIL PROTECTED] (Rod Adams) wrote in message

> Proposed behavior of *?@ : All Arguement to Parameter mapping left of it
> are processed Left to Right. Once seen, the mapping starts over right to
> left. Everything remaining is slurpable.
>
> Yes, it's more expensive to use, just like the RE version, but shouldn't
> impact performance _too_ bad when it's not, since the behavior will be
> detectable at compile time.
>
> Thoughts?

There is another problem beyond efficiency: the P6 list semantics is lazy.

The following is valid P6, AFAIK:

for 1 .. Inf {
  print $_;
  last when 10;
}

And then most of the proposed methods (including popping off [EMAIL PROTECTED]) would
not work.

There is another problem that I see with a user defined my_for. We want to
be able to write

my_for 1 .. 5 { something }

and not have to write:

my_for 1 .. 5 {something };

What is bothering me is the following: If we have a sub with the
signature:
  sub very_complicated(Int $x, Code [EMAIL PROTECTED])

how would the following get parsed:

very_complicated 7 { print "Hello," } { print " world!"}
# Those were the 3 args I wanted to pass
# and the next one is outside the call
sub next_routine {...}

It seems to me, then, that calls to user defined subs will need to end
with a semi-colon.


Abhi


Abhijit A. Mahabal                       Home: 520 N. Grant St, Apt #2
Graduate Student,                              Bloomington IN 47408
Dept of Cog Sci and Computer Science,          812 331 2286
Indiana University                       Off:  LH301I; 812 855 8898

Reply via email to