From: "trans. (T. Onoma)" Date: 2004-10-03T10:25:37+09:00 Subject: Kernel#eval taking a block Is there a reason Kernel#eval won't take a block? I wrote this to overcome: # Evaluate a Ruby source code string (or block) in the binding context def evalb( str=nil, binding=nil, &blk ) if block_given? Kernel.eval( "proc {|slf, blk| slf.instance_eval(&blk)}", binding ).call( binding, blk ) elsif str Kernel.eval( str, binding ) end end Although, I'm not sure it's exactly right --I put it together by a bit of trial and error. T. -- ( o _ カラチ // trans. / \ transami@runbox.com I don't give a damn for a man that can only spell a word one way. -Mark Twain