From: Stefano Crocco Date: 2008-09-07T05:16:49+09:00 Subject: Re: Ruby interpreter bug? On Saturday 06 September 2008, Ryan Hinton wrote: > I get a core dump when executing the following code. > > class Bob > ['hi', 'hello', 'howdy', 'goodbye'].each do |mname| > instance_eval <<-EOF > def #{mname} > puts #{mname} > end > EOF > end > end > Bob.hi > > I get the same behavior when using eval instead of instance_eval and > calling "Bob.new.hi". I know that the code isn't valid, but a core > dump seems inappropriate (maybe a SyntaxError exception?). And my > Ruby interpreter is a little old. > > $ ruby --version > ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-freebsd6] > > I'm happy to provide any further information that would be helpful. > > Enjoy! > > - Ryan It works correctly for me (ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]) Stefano