From: "Ara.T.Howard" Date: 2005-08-06T00:37:56+09:00 Subject: Re: new block notation On Sat, 6 Aug 2005, David A. Black wrote: > Hi -- > > On Fri, 5 Aug 2005, Trans wrote: > >>> That's rather drastic. All it needs is a new symbol for literal hashes. >>> (I like [| |] myself.) >> >> Nah, just use the _collection_ brackets for both array and hash. The >> parser can tell them apart: >> >> # array >> [ a, b, c ] >> >> # hash >> [ a=>x, b=>y, c=>z ] >> [ a: x, b: y, c: z ] > > I don't like to have to scan visually for a separator in order to know > what the [ meant. That seems ad hoc and fragile. it's even worse than that: jib:~ > ruby -e 'm = lambda{|x| p x}; m [ 0b101010 ]' 42 jib:~ > ruby -e 'def m a; p a.first; end; m [ 0b101010 ]' 42 jib:~ > ruby -e 'm = Hash::new{p 42}; m [ 0b101010 ]' 42 you can't even scan for these - you must know m's type... -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================