On Wed, Apr 17, 2002 at 10:23:42AM -0700, David Wheeler wrote: > On 4/17/02 9:11 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> claimed: > > > I find it amazing that someone can make a statement like "99% of the > > time, people leave whitespace of the aggregate and the index", just > > based on personal experience. > > > > Based on the code *I* have written in the past 20 years, more than > > 99% of the time people do use whitespace between the aggregate and > > the index. ;-) > > Must be a European thing. ;-) > > > Seeing $hash{foo}{bar}{baz} all over,justmakeswewanttoignoreallwhitescape. > > Butthatissohardtoread. > > Personally, I find C<$hash{foo}{bar}{baz}> a lot easier to read than > "justmakeswewanttoignoreallwhitescape". The braces break it up nicely. > However, once I start to see code like that, I start to think it's time for > a redesign. I don't much care for seeing a hash access go more than two > layers deep.
I agree. C<$hash{foo}{bar}{baz}> is horribly ugly. Your solution is a redesign. My solution is to use whitespace. The latter is far easier than the former. > > Using ()'s doesn't mean the parser suddenly understands %hash {key} > > is an indexing operator, so that's not going to solve much. :-( > > That's true. But the trade-off is significant and, IME, totally worthwhile. > Braces with whitespace in front of them are now always closures. This adds a > great deal of power and flexibility to the design. I think the gain is just the option of not having to write () in if. If () was still mandatory, there would be no ambiguity when a block is a hash index and when it cannot be - which means it has to be a closure. > But if some people just > are lamenting the loss of the whitespace in hash accesses because that's the > standard that C set long ago, the, to quote Larry, It's not just C. It's also any language than I've programmed in. It's also a rather significant break from 14 years of perl. Abigail