From: Eric Mahurin Date: 2005-10-21T01:05:58+09:00 Subject: module-based AOP (was Re: [RCR] Cut-based AOP) --- Trans wrote: > Hi Matz, > > Yukihiro Matsumoto wrote: > > > I understand the basic idea. How about introducing a new > method > > e.g. "preclude" that works to intercept the methods in the > target > > class/module, instead of cut. It would be a counterpart of > "include" > > for mix-in. > > Yes, this is in the RCR: > > Additionally, Cuts exist in proxy form to allow modules to be > "premixed". This is analogous to proxy classes which allow > modules to > mixin to the class hierarchy. So too does a proxy-cut include > a module, > albeit preclusive rather the inclusive in its effect. We > offer the > module command #preclude to serve as designator of this > purpose. > > module A > def m ; "<#{super}>" ; end > end > Class T > preclude A > def m ; "okay" ; end > end > T.new.m #=> "" Trans/Peter, What does a "cut" do that "preclude" doesn't? It seems like you still can manage the AOP methods through modules instead of cuts. And you can stack these. Can you give a scenario where "preclude" doesn't "cut" it :) I still think something like "wrap" would be a better word. "preclude" may describe the inheritance hierarchy kind of, but not the functionality from a user's perspective. __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/