From: Robert Klemme Date: 2005-01-13T20:51:17+09:00 Subject: Re: Kernel#eval and class definition "ts" schrieb im Newsbeitrag news:200501131036.j0DAa5l16543@moulon.inra.fr... > >>>>> "R" == Robert Klemme writes: > > R> That's better because then you can define methods that deal with blocks, > R> which you can't with define_method: > > This is because you use strange name like #foo and "bar"and ruby don't > like it :-) Must be a new version of Ruby that doesn't like #foo and #bar - my 1.8.1 has no problems with them. :-)) > uln% cat b.rb > #!./ruby > cl = Class.new do > define_method(:alpha) do |&block| > block["beta"] > end > end > > cl.new.alpha {|x| p x} > uln% > > uln% b.rb > "beta" > uln% Is this Ruby 1.9? robert