From: ts Date: 2004-02-27T02:38:53+09:00 Subject: Re: Callback >>>>> "H" == Han Holl writes: H> The following code works, but I was wondering if the creation of the @obj H> instance variable is really necessary? The problem is not with the instance variable, but with the evil eval :-) You don't prefer this ? svg% cat b.rb #!/usr/bin/ruby class A end class B def initialize(k, cb) class << cb; self end.instance_eval do define_method('cassette') { k } end end end a = A.new g = B.new([1,2,3], a) puts a.cassette svg% svg% b.rb 1 2 3 svg% Guy Decoux