From: Jeffrey Moss Date: 2005-01-25T02:25:55+09:00 Subject: Re: attr You know, this is commonly called "aspect oriented programming" if I am not mistaken. You may want to look into it. I didn't find this paradigm very easy to think in, but there are people out there who swear by it, so maybe you should head in that direction and name the library accordingly. I did a quick google search for aspect oriented programming ruby and found some stuff out there that's already done. (http://aspectr.sf.net/) -Jeff >> In the upcoming release of Ruby Carats I have a little lib called >> attr.rb. >> >> What it does is define a mater #define_attribute which all attribute >> defintions are routed thru. Then I redefine #attr (since current >> definition is basically never used) to call #define_attribute that > > Well.... claiming that it is "basically never used" is dangerous. I've > used it, and I know I've seen code that uses it. Changing the > semantics of an existing method is always going to be dangerous, no > matter how infrequently you believe the method is used in practice. > > Caution, caution, caution. :) > >> So I have a few questions. First, what do you think of this in general? >> Second, there is no "extra" convenient way to do an accessor b/c I >> haven't been able to find a nice notation --one just has to put both, >> 'attr :a, :a='. Is this too inconvenient? Can anyone think of a good >> notation? > > I like the features you've added, though. Could you perhaps call it > something other than "attr", to avoid breakage? > > - Jamis > > -- > Jamis Buck > jamis_buck@byu.edu > http://jamis.jamisbuck.org > ------------------------------ > "I am Victor of Borge. You will be assimil-nine-ed." > >