On Mon, May 14, 2001 at 12:32:37PM -0500, Me wrote:
> > an ordered hash is common
> 
>     Arrays too.
> 
> 
> > not wise ... to alter features just for beginners.
> 
>     Agreed.
> 
> 
> > (PS  11 people isn't a statistic, its a night at the pub)
> 
>     Your round...
> 
> 
> The extra complexity of a separate hash syntax might
> be justified for other reasons, but not the ones given.

Hm, OK. What does this access and using what method ?

  $foo = '1.2';
  @bar[$foo];

Does it access the hash element "1.2" or the array element 1 ?

Its not obvious and you cannot depend on what is in $foo, $foo = 1.2
should give identical results. and having to write

  @bar["$foo"] or @bar[int $foo]

is worse than what we have now. And solving this by saying that
each variable must be declared to be hash or array does not help
much as it moves the distinction from where it is useful to the
reader to somewhere out of site.

Having different brackets for accessing array or hash actually does
help when reading code. Using the same is just adding unnecessary
complexity

Graham.

Reply via email to