On 11/30/04 6:35 PM, James Mastros wrote:
> Austin Hastings wrote:
>> Larry Wall wrote:
>>> * We get the cute, clean and rather more typeable
>>>
>>> $var<key1><key2>[3]<key3>
"Cute" maybe (looks like a chain of fish)
> The problem with {} for a hash dereference operator is not it's
> typeablility, but rather it's autoquoting behavior from perl5.
Call me crazy, but at this point I'm prone to stick with what I've done in
Perl 5 for years:
$var{'key1'}{'key2'}[3]{'key3'}
It's the same number of characters as:
$var<<key1>><<key2>>[3]<<key3>>
and it requires no "funny" characters. I also find it a heck of a lot more
readable than any of the others. The {' '} makes a nice vertical +
whitespace "frame" around the key. The fake doubles << and >> are way too
noisy. The funny quotes look wildly different in different fonts, but
usually end up as indistinct smudges that resemble melted "=" characters.
> OTOH, $wheel.<roll> and $wheel.<shift> are both literals. (The dot
> there is optional.) (Until a little bit ago, that was $wheel.<<roll>>
> or $wheel.�roll�. (Note that I had to switch keyboard layouts again to
> type that.))
I agree that $wheel<roll> is an improvement over $wheel�roll� and
$wheel<<roll>> (although I can't decide which of those two is worse), but I
still think $wheel{'roll'} is the clear winner in all respects except
perhaps speed of typing.
-John