From: Daniel Brockman Date: 2005-08-07T05:34:14+09:00 Subject: Re: new block notation "Trans" writes: > I'm confused myself b/c I don't see any difference between > a block and a lambda. I was trying to understand what it > is, and for a moment I thought somone one saying that > 'self' was different in the two cases, but its not. > Let me back up. What is the difference? Lambdas (or procs) are anonymous functions. Blocks are what you pass to methods using `foo {...}' or `foo(&...)'. Blocks are more primitive than lambdas; you can create a lambda by passing a block to the Kernel#lambda method. You can convert a lambda to a block by using the `&' syntax (as in `&lambda {...}'), and the other way around by calling Proc.new or using the `def foo(&block)' syntax. So, to rehash: Blocks are what go in between `{' and `}', while procs, or lambdas, or (anonymous) functions, are objectified blocks (instances of the Proc class). -- Daniel Brockman