On Sat, May 14, 2005 at 01:36:22PM -0500, Rod Adams wrote:
: Larry Wall wrote:
: 
: >On Sat, May 14, 2005 at 12:51:32PM -0500, Rod Adams wrote:
: >
: >: Unless, of course, there is some subtle difference between a 3-d hash 
: >: and a hash of hashes of hashes that invalidates this.
: >
: >No difference, I hope.  The multidimensional notation is meant
: >to extend to HoH and AoA transparently (as well as HoA and AoH).
: >Since a variable's dimensionality is always declared (and a container
: >object's dimensionality generated at "new" time), we shouldn't have
: >to worry about whether to add dimensions or autovivify a reference.
: >Either there's storage already allocated, or we autovivify.
: > 
: >
: Hmm. So if I say:
: 
:    @a = [ { a => 1, b => 2}, { a => 3, b => 4 } ];
: 
: Can I then say:
:   
:    $x = @a[1;'b'];
: 
: And get $x = 4?

Probably not, but @a{1;'b'} might.  I think what we've said before is
that .[] allows the optmimizer to assume numeric subscripting only,
while .{} is the more general form.

Larry

Reply via email to