On Fri, 20 Sep 2002, John Williams wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
: >
: > Yes, in fact any list forced into scalar context will make a ref in Perl 6:
: >
: > $arrayref = (1,2,3);
:
: That would seem to obviate the need for brackets to define array
: references. Is there any case where [1,2,3] would be needed instead of
: (1,2,3)?
Sure, in a list context. [1,2,3] is really short for scalar(1,2,3).
: Also, does "any" list include a list of pairs? Because that would look
: more like a hash than a list.
:
: $ref = ( one => 1, two => 2, three => 3);
Sure. If you really want a hash, use {...}. (Extra rules apply
for parameter lists, though.)
Larry