On Saturday, October 5, 2002, at 09:33  PM, Larry Wall wrote:
>
>
> : Additionally, parentheses have one inconsistency which brackets do 
> not:
> : This is the following case, already shown on perl6-language:
> :
> :     $a = ();        # $a is a list reference with 0 elements
> :     $a = (10);      # $a is the scalar 10
> :     $a = (10, 20);  # $a is a list reference with 2 elements
> :     # ...
> :
> : If the ability to construct lists with parentheses is removed, so is 
> this
> : inconsistency.
>
> I don't think that's an important inconsistency.

[SNIP]

>
> : This has the added benefit that there is a significant
> : visual clue about when a list is being tossed around.  This doesn't 
> break
> : any convenience, just changes the look of it:
> :
> :     # Perl 6                # Perl 5
> :     [$a, $b] ^= [$b, $a];   # ($a, $b) = ($b, $a)
> :     print *[$a=$b],"\n";    # print(($a=$b), "\n");
> :     push @a: *[1,2,3];      # push @a, (1,2,3);
> :     push @a: [1,2,3];       # push @a, [1,2,3];
>
> I'd rather they just work the way people expect from Perl 5.  Requiring
> people to say *[1,2,3] when they could say 1,2,3 is needless 
> obfuscation.

I think needless obfuscation is treating $a = (10); as a scalar instead 
of a list reference containing one item when the rest of the the $a = 
() are list references.

-Noah

Reply via email to