From: Peter Vanbroekhoven Date: 2005-10-22T00:12:20+09:00 Subject: Re: [RCR] Cut-based AOP On Fri, 21 Oct 2005, Eric Mahurin wrote: > I don't like the cut syntax either. It doesn't seem to > describe what it is doing very well. But, I don't think the > above is a good solution either. > > To me, making a cut into a class is analogous to reopening a > class. The difference is that super and superclass refer to > the original class (or another cut in between) for cut and the > parent class when simply reopening a class. Here is what I > mean: I see. So is that the problem? You have a different concept in your head, cuts don't mesh with that concept, so cuts should go. The concept you just mentioned, and which is what we started from two years ago, is one we found flawed. What we want to advocate with cuts is to do AOP by adding a layer to a class. That layer is essential to our proposal. So it is certainly not reopening a class, it is like adding a layer on top. And that is what subclassing does too, it adds a layer on top of the subclass, hence a syntax like that of subclassing. The difference is in how that layer is used, not in how it is defined. This layering approach makes managing these wrapper methods rubyesc. And managing them is of the essence. To us that was what was missing from Matz' approach at method combination. So I want to stress, it is not like reopening a class. Our point is exactly that the methods of the class and those of the layers on top are separate. This means they can be redefined independently in a simple and Rubyesc way. Of course if you just want to add a little wrapper method to a method and never look back to it again --you're giving the impression that you see this as the value of all this-- then I'm sure that our approach does not make sense. > > > The syntax is not consistent: > > class B meta-class of b > ------- --------------- > reopen class B ... end class < cut cut Bcut < B ... end cut < Has the "cut <<" syntax been implemented in the patch? Yes. Peter