From: Daniel Amelang Date: 2005-03-21T11:31:05+09:00 Subject: New block syntax I'm really sorry if this isn't the place to talk about this. I've already brought it up on ruby-talk, but I think ruby-core is where the people involved in the issue are. I really like the new proposed syntax for proc/blocks: b = {|| puts "good idea"} But the empty pipes make it ungraceful, in my opinion. I understand the need to differentiate between the {} syntax for blocks and the {} syntax for hashes. Thus, I propose that instead of changing the block syntax to resolve the ambiguity, we change the hash syntax. Consider the following alternative hash constructs: # The key value pairs completely differentiate the hash from an array, # allowing us to borrow the [] from array's constructor hash = [name:'bill', age:25] # So what does an empty hash look like? Here's one possiblility. hash = [:] If the preceding syntax were adopted, the {} braces would no longer partially belong to hash, but entirely to blocks/procs, giving us much needed flexibility in syntax. # Now this works! b = { puts "good idea?" } # This is a method call with an empty hash as an argument, # and a block passed in. # The current way of doing this is do_it({}) {} , which isn't that bad. do_it [:] {} Just an alternative to the current approach. Thanks for your attention! Dan