From: "Ara.T.Howard" Date: 2005-10-07T12:41:50+09:00 Subject: Re: foo= ... the only exception to the implicit-self rule ? On Fri, 7 Oct 2005, itsme213 wrote: > > "Ara.T.Howard" wrote in message > > news:Pine.LNX.4.62.0510060818160.2730@harp.ngdc.noaa.gov... >> it's just my opinion, but i think this is clear as a whistle: >> >> color 'blue' >> width 42 > > It is clear. But by munging writer and reader into a single method, it makes > some kinds of manipulations of the methods difficult (e.g. programatically > generating synchronization based on readers and writers). you actually get both here. if you do trait 'color' => blue you can p color color 'blue' self.color 'blue' the code actually delegates the setting to the setter method so, if you were over-ride you setter to something like def color= c raise unless %w( red blue green ).include? c @color = c end the this color 'mauve' still works as expected. not only that but every trait gets a query method too so you can if color? ... end cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================