From: Chad Fowler Date: 2003-11-28T13:38:13+09:00 Subject: Re: pre/post question/idea On Fri, 28 Nov 2003, Joey Gibson wrote: # # 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. # Interesting. This is obviously a very subjective thing. To me, the foo:pre, foo:post style syntax reminds of this kind of anti-pattern: my_person.parent_name = "John Smith" my_person.parent_age = 64 my_person.parent_address = "123 Foobar Rd." (thankfully, this is a pattern I rarely see in Ruby but often run across in Java programmers) :) This code is screaming for an object to handle "parent". But instead of making that object explicit, the programmer is using special-case programmer-specific notation to mark "parent" attributes. foo:pre looks the same to me. It takes something that feels like it should stand on its own two feet, and makes it instead piggy back as a symbol matching/parsing hack on top of the current "def" mechanism. At any rate, I'm not going to lose any sleep or be unhappy if the original matz proposal wins out. 6 of one--a half dozen of the other, ultimately. Chad