From: Massimiliano Mirra Date: 2002-07-08T20:24:09+09:00 Subject: Re: String#each On Mon, Jul 08, 2002 at 11:05:18AM +0900, Mark Slagell wrote: > Whenever there's some defensible reason for why something works as it > does, even if there are pretty good arguments that it would have been > better if it had been done some other way, we need to lean heavily > toward preserving the status quo for that behavior. > > For my purposes anymore, basically any code breakage is too much. I sure > don't want to worry about things going wrong with scripts that are in > production use whenever I upgrade the interpreter, and I've been relying > heavily on Ruby at work for quite a while. Imagine this... There is a 16compat.rb file in ruby1.8 lib directory. By requiring it, all language features that have been changed (not added) in 1.8 assume 1.6 behaviour. You could put a require 'compat16' in your script, and you would be sure that, if it ran under 1.6, it will run for you. You could even set that system-wide to be sure (e.g. `ruby' is really a script containing `ruby -rcompat1.6') and require 'compat18' for new projects. Most important, by doing so on the new project, whatever change will happen in ruby2.0 you already know your script will still run because compat18.rb in ruby2.0 will take care of it... Just a thought. Massimiliano