From: Austin Ziegler Date: 2003-07-17T12:52:31+09:00 Subject: Re: callbacks in ruby and using yield in resursion On Thu, 17 Jul 2003 10:59:31 +0900, maillist@bestworldweb.homelinux.com wrote: > It works! Thanks very much. One thing I don't get... what exactly is > the &block, is it a reserved work, a predefined variable or what??? No, it's just another variable. The only thing special here is the '&' and that it must be the last variable. I think that it's more or less conventional to call block variables &block, but that's convention. Passed blocks can be called with yield (although not by name, afaict), by &block.call, or even eval'ed (I have instance_eval &block in a number of places in my modules). Implicit blocks aren't named and can only be called with yield and detected with Kernel#block_given? -austin -- austin ziegler * austin@halostatue.ca * Toronto, ON, Canada software designer * pragmatic programmer * 2003.07.16 * 23:44:52