On 03/31/2011 11:16 PM, Aaron Sherman wrote:
> # parens on the arglist causes flattening?
> $ ../rakudo/perl6 -e 'for 1 .. 2 X 4 .. 5 -> ($a, $b) { say $a.perl, $b.perl 
> }'
> Not enough positional parameters passed; got 0 but expected 2 in sub-signature

The error message already tells you that you wrote a sub-signature.
I'm not sure what positional parameters in a sub signature should mean
though - do you?

> # Lack of parens gives lol context?

Rakudo doesn't properly implement lol context, so probably not.

> $ ../rakudo/perl6 -e 'for 1 .. 2 X 4 .. 5 -> $a, $b { say $a.perl, $b.perl }'
> 14
> 15
> 24
> 25

looks more like flattened to me.

> # Default context is flat?
> $ ../rakudo/perl6 -e 'for 1 .. 2 X 4 .. 5 { say .perl }'
> 1
> 4
> 1
> 5
> 2
> 4
> 2
> 5

yes.

Cheers,
Moritz

Reply via email to