From: Daniel Amelang Date: 2005-06-30T13:50:42+09:00 Subject: Re: iterators and block arguments Well, let's look at what our code looks like now vs. how it would look: # Current way def meth(num) yield(num) if block_given? end meth 42 { |num| puts num } # Unified block/proc way def meth(num, block=nil) block.call(num) if block end meth 42, { |num| puts num } Nothing too strange, except for that comma in the argument list when you call the method, since the block is now just a regular parameter. So when you call 'inject' now, it'd look like this: sum = [1,2,3].inject 0, { |s, n| s + n } That comma does look a little funny. Not a big deal, though. Where's David Black? He usually beats these heretical ideas down pretty fast. :) Seriously, though, getting rid of the yield keyword, block_given?, the whole & thing for converting between blocks/procs and the concept of blocks now being just regular parameters is a big change. The result would border on a whole different language. It is _conceptually_ pleasing to unify them. Does it really make our lives easier? Dan