Thanks, I’ve been wondering what the changes were for a while now. I didn’t
join the list long enough ago to be in on some of the discussion.
I took a look and there were a few things that stood out:
$VERBOSE now has 3 levels
nil - silence, false - medium (default), true - verbose
Ugh! That looks like it was probably done for backwards compatibility
reasons, but it is really counter-intuitive. I’ve never seen a situation
where false was a “medium” setting between nil and true. Any hope of
changing this to a more sane set for the next major release?
String#to_i
Now accepts optional base argument.
“101”.to_i(10) => 101
“101”.to_i(2) => 5
“101”.to_i(8) => 65
“101”.to_i(16) => 257
Yay! This is great.
A base argument of 0 guesses at the base:
“101”.to_i(0) => 101
“0b101”.to_i(0) => 5
“0101”.to_i(0) => 65
“0x101”.to_i(0) => 257
Well, I like the idea of guessing the base, but is 0 really the right optional
argument to use here? Shouldn’t it be a string (“guess”) or some other
value? Using 0 as an out-of-band value seems like C code rather than OO
code, where you’re forced to use a certain type of parameter so you have to
use certain values as “out of band” values.
Other than that, it looks like a really nice set of changes, some tweaks to an
already great language.
Btw, sorry if these issues have already been discussed, but this is the first
time I’ve seen them.
Ben
···
On Mon August 4 2003 11:38 am, Michael Granger wrote:
I’ve put up an HTMLized version of this file at:
http://dev.faeriemud.org/changes-1.8.0.html. It includes a link to the
slightly tweaked version of ‘changes.1.8.0’ I used.