From: Joey Gibson Date: 2003-11-28T13:00:12+09:00 Subject: Re: pre/post question/idea On 11/27/2003 10:47 PM, Chad Fowler wrote: >On Fri, 28 Nov 2003, David A. Black wrote: > ># 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 > >This is excellent. I hope there aren't any gotchas that nobody has >thought of. You're right about the "splicing" thing. This feels a lot >more like it's supposed to be a part of Ruby. > I much prefer the foo:pre, foo:post way to this. Of course the first time I saw this (apart from doing AspectJ work in Java) was in Lisp, and what Matz proposed was lifted straight from Lisp. Using 'pre' and 'post' as equivalents of 'def' seems a bit of a hack, to me. I think the foo:pre syntax is more explicit in expressing what you are trying to do that this. Joey -- Never trust a girl with your mother's cow never let your trousers go falling down in the green grass... http://www.joeygibson.com/blog http://www.joeygibson.com/blog/life/Wisdom.html