From: "T. Onoma" Date: 2003-11-28T12:14:06+09:00 Subject: Re: pre/post question/idea On Friday 28 November 2003 03:32 am, David A. Black wrote: > As we're still pre-2.0, and talking about pre and post, I thought I'd > throw in a bit of possible syntax for this that occurred to me, namely > this: > > class C > def x > puts "how are you?" > end > > pre x > puts "hello" > end > > post x > puts "goodbye" > end > end > > It's possible that there are problems with doing it this way that I'm > not seeing, but personally I like the way it looks better than > > def x:pre > > which to me has a bit of a "spliced onto the language" feel (which > perhaps it is, but it would still be nice to avoid that feel :-) I > like the simplicity and symmetry of separate def/pre/post. Sorry David, your a little late to make claims on that one. If you read my AOP RCR (which by the way I think I've plugged like six times now) you would notice that I offer: wrap w super print "W" end as a backup alternative to my primary proposal, which I belive to be a far superior: class C def x puts "how are you?" end def x puts "hello" super puts "goodbye" end end Before anyone looks at this and crys "foul!", read the dang RCR. http://www.rubygarden.org/ruby?AspectOrientedRuby -t0