At 01:29 PM 7/31/2003 -0400, Hanson, Rob wrote:
> Anyone but me feel the need for non-greedy
> slurpy arrays? similar to non-greedy RE matches?

I definately like the idea of having something like that.  It probably
wouldn't be used much, but it is nice to have the option.

One thing though, can't you accomplish the same thing by slurping
everything, then poping the block off of the array?

One could do most of the stuff in P6 parameters with P5's @_. But as Damian showed at the end of E6, it can quickly grow to a nightmare, and making it nicer is what P6 is all about.


-- Rod


Rob

-----Original Message-----
From: Rod Adams [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 12:56 PM
To: Perl 6 Language
Subject: Re: Perl 6's for() signature


At 10:05 AM 7/31/2003 -0600, Luke Palmer wrote: >Well, I don't think it's possible, actually. There's a flattening >list context at the beginning (implying a sugary drink from 7 eleven), >followed by a code block. But, as we know, slurpy arrays can only >come at the end of positional parameters.

Anyone but me feel the need for non-greedy slurpy arrays? similar to
non-greedy RE matches?
Then we could do:

sub for ([EMAIL PROTECTED], &block) {...}

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?



Reply via email to