From: Kent Dahl Date: 2002-07-23T21:06:18+09:00 Subject: Re: define_method with super in the proc ts wrote: > Tue Oct 16 23:29:26 2001 Yukihiro Matsumoto > > * eval.c (rb_call0): self in a block given to define_method now be > switched to the receiver of the method. Thank you. Since this is on the main branch, I take it the best bet would be to compile from CVS and stay on the 1.7.* branch, if we want to use define_method. However, after compiling it up (ruby 1.7.2 (2002-07-13) [i686-linux]), I notice that this doesn't solve the super problem Tom had. (Which probably means I probably was of on a big goose chase.) Anyway, back to the original problem. Tom, you could alias the super method and pass its aliased name into the makeproc and call it explicitly: class A attr_reader :x, :y def doit @x = 5 end end def makeproc( supername ) Proc.new { self.send(supername) @y = 10 } end B = Class.new(A) B.class_eval { alias doit_super_A doit define_method(:doit, makeproc(:doit_super_A) ) } b = B.new b.doit p b #=> # HTH, and sorry for depressing you in my previous post :-) -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 4. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)