From: Florian Frank Date: 2005-06-30T13:31:23+09:00 Subject: Re: yield does not take a block Adam P. Jenkins wrote: > obj.method_that_takes_two_blocks {|a| ... }, {|b| ...}, third_arg > > See, in the last (hypothetical) syntax, proc is just a kind of object > that happens to have a literal syntax for defining it, just as arrays > and hashes do, but is otherwise just like any other object, and is > passed as an argument just as anything else is passed as an argument. > That's all I'm suggesting, and wondering why it's not that way, or if > it couldn't be made that way in Ruby 1.9. It is made that way in current Ruby 1.9: >> def compose(f, g) { |x| f[g[x]] } end => nil >> h = compose({ |x| 2 * x }, { |x| x + 1 }) => # >> h[3] => 8 -- Florian Frank