From: Hal Fulton Date: 2005-03-22T15:18:16+09:00 Subject: Re: unifying hash and proc syntax Joel VanderWerf wrote: > Hey, crazy idea. Why not use the same syntax for hashes and arrays? For > example: > > { > 1 => 2, > 2 => 3, > 3 => 4, > |x| > x + 1 > } > > This is essentially a hash with a default_proc that adds 1 to its argument. > > Leave out the => pairs and you get something that acts like a proc. > Leave out the |...|... construct and you get something that acts like a > hash. With both, it's a hash with a default proc. It's a fllor wax AND a dessert topping! > It's backwards compatible. Delicious! And just look at that shine! > Are there any syntactic ambiguities? Hmm, not sure. But it certainly gives me a headache to think about it. Hal