On Fri, 16 Apr 2004 23:45:48 +0200, Juerd wrote:
> Jonathan Scott Duff skribis 2004-04-16 15:51 (-0500):
> > Except that you've put things in this explanation that shouldn't be
> > there IMHO. The %varname<<key>> is a special case, but not of "getting a
> > single item from a hash", rather it's a special case of a one element
> > list generated from << >> evaluating to the element. So, if you remove
> > that bit, it's the same as the two below just with different syntax.
> 
> I think %hash<<key key key>> is best explained as %hash{ << key key 
> key >> } with implicit curlies, not as an alternative to curlies.

In that case, why aren't you suggesting something more in line with that?
Here's what I'd like to see instead of your suggestion:

  %hash<<key key key>>  ===  %hash{<<key key key>>}
  %hash'key'            ===  %hash{'key'}
  %hash"key"            ===  %hash{"key"}

That has
* as few keystrokes as perl5's $hash{key}
* delimiters at both ends, so you can even use non-bareword constants
* existing syntax reused in the same way as the <<>> variant
* interpolation allowed in the double quoted variant.

That said, I really wish we could keep perl5's $hash{key}. It's obviously a
subscript, and I use constant bareword keys much more frequently than zero-arg
sub/builtin calls in hash subscripts.

-- 
        Peter Haworth   [EMAIL PROTECTED]
"The capacity of human beings to bore one another seems to be vastly greater
 than that of any other animals.  some of their most esteemed inventions
 have no other apparent purpose, for example, the dinner party of more than
 two, the epic poem, and the science of metaphysics."  -- H. L. Mencken

Reply via email to