Larry Wall larry-at-wall.org |Perl 6| wrote:
At compile time the subscript parser really only knows how
many dimensions are referred to by how many semicolons there
are. A subscript that is explicitly cast to @@ is known to be
multidimensional, and interpolates the returned List of Capture into
the outer List of Capture, and the compiler can make no compile-time
assumptions about how far down the dimension list any subsequent
dimensional sublists will end up.
What I still want to know is:
When does . provide a single item, rather than a list (a list that
might contain only one item)?
$x = @array[$n]; # I expect $x holds the single result, not a list
of one item!
$x = @array[foo()]; # what about now?