From: Paul Brannan Date: 2008-04-23T23:07:38+09:00 Subject: Re: Performance on method dispatch for methods defined via define_method On Wed, Apr 23, 2008 at 04:03:09AM +0900, Robert Dober wrote: > module M > x = 42 > define_method :a do x end # Cannot be inlined > define_method :b do some_call; @x end # Can be inlined as if def were used > end You can "inline" (it's really not the right word) either one using nodewrap, but it's very evil to do: /home/user> irb1.9 irb(main):001:0> require 'nodewrap' => true irb(main):002:0> p = proc { 42 } => # irb(main):003:0> p.body => irb(main):004:0> class Foo; end => nil irb(main):005:0> Foo.add_method :foo, p.body, Noex::PUBLIC => nil irb(main):006:0> Foo.new.foo => 42 Paul