On Tue, 24 Sep 2002, Mike Lambert wrote:
> >
> >   $a = (1, 2, 3); # Same as Perl 5's $a = [1,2,3];
>
> $a = (1) should then do $a = [1], according to the above.
>
> This implies that:
>
> ($a) = (1) implies that $a is [1], something I don't particularly agree
> with.
You may be missing the change in the comma operator.  Perl5 uses the
"return the rightmost value" comma from C.  Perl6 is changing the comma to
a "list constructor".   So (1,2,3) is definitely a list, but (4) probably
isn't.


If I understand our non-conclusions so far, we're waiting for Larry to
clarify:

 1)  how to create a 1-tuple/1-item list?

 2)  how to interpret the flattened list context?  e.g. given this:

>       $x = (1,2,3);
>       @y = (1,2,3);
>       $z = [1,2,3];
>       push @a, $x, @y, $z, (1,2,3), [1,2,3];

    What flattens, what doesn't, and how do you override the behavior?


Is there anything I missed?

~ John Williams


Reply via email to