From: Morton Goldberg Date: 2006-10-19T13:08:13+09:00 Subject: Re: whats this lambda code doing? On Oct 18, 2006, at 10:48 PM, Ezra Zygmuntowicz wrote: > What it is doing with the inject is essentially building up a > block with multiple procs inside it and then calling that. So the > block that gets called looks something like this by the time it > gets call'ed: > > lambda { > lambda { Foo.with_block hash, &blk } > lambda { Bar.with_block hash, &blk } > lambda { Baz.with_block hash, &blk } > }.call Maybe I'm being even more dense than usual, but I can't accept that. It wouldn't produce the observed print-out order. I think it must be more like: lambda { Baz.with_block(hash, lambda { Bar.with_block(hash, lambda { Foo.with_block(hash, &blk) }) }) }.call Regards, Morton