From: dblack@... Date: 2007-02-21T05:11:07+09:00 Subject: Re: adding local variables via block Hi -- On Wed, 21 Feb 2007, Tim Pease wrote: > In the more general case, you would need to use one of the 'eval' > methods in order to create a new local variable in a local namespace. > However, (1) the 'eval' methods work only on strings and not blocks, > and (2) they are mostly evil and should be handled with great care. Actually the only one that works only on strings is eval. instance_eval and class_eval work on blocks too. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)