From: Daniel Brockman Date: 2005-08-07T00:36:42+09:00 Subject: Re: new block notation "David A. Black" writes: > Hi -- > > On Sat, 6 Aug 2005, Daniel Brockman wrote: > >> "David A. Black" writes: >> >>> I'm still not seeing how >>> >>> [:] >>> >>> or >>> >>> [=>] >>> >>> conveys the notion of 'emptiness' better than >>> >>> {} >> >> The reason people are suggesting the [:] syntax is to avoid >> the confusion with blocks. Since {} doesn't avoid the >> confusion with blocks, [:] is in this sense better. > > I may be taking the discussion in a circle, but... what confusion > with blocks? (I'm confused about the confusion :-) I shouldn't have said confusion, but ambiguity, or conflict. In 1.9, {} is a hash while {||} is a proc. If the {} syntax were freed up to be used exclusively by blocks/procs, we could have {} and {||} be procs, while [:] would be a hash. I guess the confusion is this: {} # hash {||} # proc foo {} # block foo({}) # hash foo {||} # block foo({||}) # proc Compare that to the arguably saner {} # proc {||} # proc foo {} # block foo({}) # proc foo {||} # block foo({||}) # proc [:] # hash foo [:] # hash foo([:]) # hash -- Daniel Brockman