From: ts Date: 2006-05-14T21:05:01+09:00 Subject: Re: Making sense of the various Ruby "eval"s >>>>> "P" == Pat Maddox writes: P> define_method: "Defines an instance method in the receiver...This P> block is evaluated using instance_eval..." Well, the block is not really evaluated with instance_eval moulon% cat b.rb #!/usr/bin/ruby class A def create_method(name, &block) self.class.send(:define_method, name, &block) end end class B def a A.new.create_method(:a) { def b() end } end end B.new.a A.new.a A.new.b moulon% if the block '{ def b() end }' is evaluated with instance_eval, ruby will create a singleton method, otherwise my script will work. moulon% ./b.rb moulon% Guy Decoux