> >>  but wait, there's more... what does:
> >>
> >>  @multi_dim[$a][$b][$c]
> >>
> >>  give?
> >
> >Who cares? So long as the intermediate results in
> >@multi_dim.[$a].[$b].[$c] respond to [].
> 
> Hrm. Will they need to? That could arguably pass a three
> element key  ($a,$b,$c) to @multi_dim which, conveniently
> being a  three-dimensional array, returns a value itself.

For certain definitions of "array", if you missed my earlier
post, then I forgot to say that @multi_dim is a mixed data
structure:

$a is a hash key
$b is an array index
$c is another hash key

So, if I try:

@multi_dim[$b][$a][$c]

then it's obviously going to break.  But how can I, the
programmer, easily spot that?  It's not as clear as:

@multi_dim{$a}[$b]{$c}

where I can see what I'm getting as I work through the
data structure.

In short, the suggestion was to aggregate [] and {}...
i.e. aggregate the notations for hashes and arrays.
Probably leaving Perl with:

* The thingy complex datastructure, you'll need to look
  back to what I wrong earlier to find out what it is.
  Oh, but it breaks without strict, cause you don't need
  to tell it.

If it is meant to be an array and you have strict
turned off, then what should Perl store this as:

for my $outer (1..10) {
    for my $inner (1..1000, 'A', 'B') {
        @data[$outer][$inner] = <>;
    }
}

[using Perl 5 syntax mixed with this idea]

To make the symbols {} and [] aggregate you'd have to
default [] to using hashes - and force it back to
arrays using explicit syntax.  You can't automagically
decide that it's never going to be used like a hash.

I'm I beating this point to death, or do I have to write
the RPC:

"Keep the {} and [] notation for hashes and arrays"

or

"Save our array!"

to make it clear it'd probably be less popular than the
-> to . change, which I do... reluctanty... see the
benefit of.

Of course, if I have to do that I need the original
suggestion as an RPC too - so I can reference it.

If in doubt on this matter, see RPC 28:

http://dev.perl.org/rfc/28.pod

Jonathan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Reply via email to