From: Michael Lazzaro [mailto:[EMAIL PROTECTED]]
>
> Just to clarify... in P6, is this an array reference, or a list
> reference?
>
> [1,2,3]
Exactly. It's still up in the air...
Apoc 2, RFC 175:
> So it works out that the explicit list composer:
>
> [1,2,3]
>
> is syntactic sugar for something like:
>
> scalar(list(1,2,3));
>
> Depending on whether we continue to make a big
> deal of the list/array distinction, that might
> actually be spelled:
>
> scalar(array(1,2,3));
> What about this?
>
> \@array
hmm. As perl Apoc2, Lists, RFC 175... arrays and hashes return a reference
to themselves in scalar context... I'm not sure what context '\' puts them
in.
I'd guess \@array is a reference to an array reference.
> I'd say both of them are array references, but there's no variable
> associated with the first one -- it's just an anonymous
> container. So
>
> I'd rewrite the definition to:
>
> - Lists are an ordered collection of scalar values
> - Arrays are containers that store lists
>
> (Coupled with Uri's explanations, of course... it's the 'container'
> part that allows read/write, as opposed to simply read.) Yes/no?
I'd just stick with Uri's explanation. Arrays are allocated. Lists are on
the stack...
It doesn't need improving... The only question is whether it is still
accurate in the _context_ of Perl6 ;)
> But is it OK for a list to be silently promoted to an array when used
> as an array? So that all of the following would work, and
> not just 50% of them?
>
> (1..10).map {...}
> [1..10].map {...}
>
> (@a,@b,@c).pop
> [@a,@b,@c].pop
There's only one person who can answer that... and he's not reading ;)
--
Garrett Goebel
IS Development Specialist
ScriptPro Direct: 913.403.5261
5828 Reeds Road Main: 913.384.1008
Mission, KS 66202 Fax: 913.384.2180
www.scriptpro.com [EMAIL PROTECTED]