From: "Mauricio Fernández" Date: 2004-04-20T06:05:35+09:00 Subject: Re: convert yield to proc On Tue, Apr 20, 2004 at 05:32:22AM +0900, Dan Doel wrote: > The original problem with the code was that he was instance_evaling the > block in #mode. So if no block was passed, he'd end up with something like > the following: > > instance_eval do > yield > end > > And you can't yield in a block given to instance eval (not sure I totally > understand why, but I have a gut feeling that you shouldn't try it :)). irb(main):002:0> def foo; "aa".instance_eval{ yield } end => nil irb(main):003:0> foo{puts "adsda"} adsda -- Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com * JHM wonders what Joey did to earn "I'd just like to say, for the record, that Joey rules." -- Seen on #Debian