From: ts Date: 2003-05-26T20:29:05+09:00 Subject: Re: super, aliases, defadvice, AOP, and so on >>>>> "Y" == Yukihiro Matsumoto writes: Y> and http://www.rubyist.net/~matz/?date=20030514#p02 Mix this with [ruby-talk:53186], and you have svg% cat b.rb #!./ruby module M def initialize:hook(a) p "M::hook #{a.inspect}" super end end class A include M def initialize(a) p "A : #{a}" end end module N def initialize:hook(a) p "N::hook #{a}" super 12 end end class B < A class << self def allocate:hook p "allocate:hook" super end end include N def initialize(a) @a = a p "B#initialize" super end end puts "=======================" p B.new(24) puts "=======================" p A.new(36) class B class << self undef allocate:hook end undef initialize:hook end puts "=======================" p B.new(24) puts "=======================" p A.new(36) svg% svg% b.rb ======================= "allocate:hook" "N::hook 24" "M::hook 12" "B#initialize" "A : 12" ./b.rb:39: warning: invalid inspect_tbl value # ======================= "M::hook 36" "A : 36" # ======================= "B#initialize" "A : 24" # ======================= "M::hook 36" "A : 36" # svg% I still don't like it Guy Decoux