From: David Alan Black Date: 2001-12-11T10:01:01+09:00 Subject: [ruby-talk:28159] Re: The benefits of dynamic typing? Hello -- On Tue, 11 Dec 2001, Mark Hahn wrote: > That looks correct. If String::to_s is fast (it should be since there is > nothing to do) then this is even simpler: > > class String > alias old_plus + > def +(x) > old_plus x.to_s > end > end > > But my point was the arguments being made against this feature fell into the > "protecting programmers from themselves" category which I have a big problem > with. Some of the arguments fell into or near that category, but only some. In any case, the ability to change the behavior of the method in a few lines of code is as much a reality of Ruby as is the fact that String#+ only takes strings. So, in totality, the language actually does offer the freedom you're talking about. > How does everyone else feel about "protecting programmers from themselves"? > At what point does a compiler switch from being helpful to being a pain? Personally, I would say that the Ruby interpreter would make precisely that switch if it started trying to guess and recover from a lot of what are now exceptions and fatal errors :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav