From: Robert Klemme Date: 2005-11-09T22:42:13+09:00 Subject: Re: gsub and gsub! are inconsistent David A. Black wrote: > Hi -- > > On Wed, 9 Nov 2005, aurelianito wrote: > >>>> what I can see is that there is no consensus on how the bang >>>> methods should behave. May be, the always self returning bang >>>> methods can be made available with an external library (there is >>>> an trivial implementation for a bang method to return always self >>>> :D). Is it already in the facets library? (right there with the >>>> "message eating" nil). >>> >>> You realize you may break the Ruby standard library by doing that? >> >> >> Ups! >> You are right. >> >> I see three choices: >> 1 - use the caller method to change the bang methods to behave >> differently depending on the caller. >> 2 - Use the rubycon tests to check how the standard library works >> with the modified methods. >> 3 - Leave it as is, and complain that I don't like it. >> >> Option number one is really nasty. >> Option number two is too much work. > > And also *incredibly* fragile. It's really not an option. > >> Option number three seems to be the right choice. > > 4. Investigate the various libraries on RAA that let you make > temporary changes to core behavior. > 5. Wait until Ruby 2.0 and the possibility of selector namespaces. > > (You can of course combine either of this with complaining that you > don't like it :-) I'd like to add another option to the mix: 6. Don't complain and accept it the way it is. This form of serenity can help a great deal in modern life. :-) Kind regards robert