From: George Ogata Date: 2004-08-06T10:41:27+09:00 Subject: Re: procs/blocks - blocks with procs, blocks with blocks? Matt Maycock writes: [snip code] If I understand what you're trying to do, the latest (CVS) ruby allows blocks to take blocks. irb(main):001:0> lammy = lambda{|&b| b.call} => # irb(main):002:0> lammy.call{10} => 10 irb(main):003:0> > I still don't know why I can't use a block with the normal use of > []... is that going to ever change? > > I know I can do obj.send(:[], *args) or obj.[](*args) -- but I think > we all know using obj[*args] is best! :-) I don't know if it will change or not. I'm somewhat impartial to it, though. I always thought the rationale for Proc#[] was not for saving keystrokes, nor for kludging a #() operator, but rather to allow a compact representation of a procedurally generated collection. E.g., instead of explicitly using an array of the numbers [0, 2, 4, ..., something_big], you can just use lambda{|x| 2*x}. These sorts of uses generally have no business taking blocks. I could of course be wrong, though.