In a message dated Tue, 24 Sep 2002, Mike Lambert writes:
> Consider:
> $a = (1);
> and
> ($a) = (1);

Yes?  They both do the same thing--set $a to 1.  It looks like the bottom
one is a list assigned to a list, but that might be optimized out, as it
doesn't matter.

> > 5.  Assignment to arrays and lists.
> >
> >   $a = (1, 2, 3); # Same as Perl 5's $a = [1,2,3];
>
> $a = (1) should then do $a = [1], according to the above.

I most definitely did not write that.  Did you read my conclusion?
One-tuples are special and can't be created simply with round parens.

> This implies that:
>
> ($a) = (1) implies that $a is [1], something I don't particularly agree
> with.

Once again, did you read my conclusion?  One-tuples are special.

>
> How would you resolve this contradiction you've created? (Or do you think
> the last example is perfectly fine?)

No contradiction.  One-tuples are special.

> What about:
> $a = 1,2,3

I don't know.  I think Larry must adjudicate.

> ($a) = (1,2,3)

$a gets 1, I think.  Otherwise you can't do list assignment where you
throw away the trailing elements, which is a very common and useful thing
to do in Perl 5.  Losing that ability in Perl 6 would be a great loss.

> $a = (1,2,3)

By definition, according to Larry, $a is [1,2,3].

> ($a) = 1,2,3

Same as without the parens.  Larry must decide.

> Do you still believe those should be identical? They have the same
> problems mentioned above, and likely other issues as well.

Oh, wait, I think I see where you're going.  You didn't read the whole
thread to date before responding.  I later quoted my own text there and
said that arbitrary X was not what I meant.  I meant a single scalar item,
such as 7, but I changed it to X in an effort to be general without
considering what that meant.  My mistake.

Trey

Reply via email to