From: matz@... (Yukihiro Matsumoto) Date: 2001-08-23T10:16:41+09:00 Subject: [ruby-talk:20141] Re: Another Possible RCR - Wrappers via Mixins Hi, In message "[ruby-talk:20127] Another Possible RCR - Wrappers via Mixins" on 01/08/23, Stephen White writes: |The main difference between mix-ins and multiple inheritence is (to my understanding) that parent classes do not call child code, but mix-ins do. Well, it's not the difference. The difference between Multiple inheritance and Mix-in is that Mix-in module cannot have instance, that's all. Mix-in is merely restricted MI. |Given this, perhaps mix-ins are a good place to do AOP style wrappers? If a mix-in has a method with the same name as the class being mixed into, then the mix-in code gets called then super's up. But I think your proposal is interesting. I was going to accomplish it (if I do), by using method combination ala CLOS. Note it's just an idea, syntax is not fixed: module WrapFred def fred :before puts "1" end def fred :after puts "2" end end include WrapFred def fred puts "hello" end will print 1 hello 2 matz.