From: Roger Pack Date: 2009-05-01T21:06:30+09:00 Subject: Re: a few thoughts for ruby... > Thought I'd pass these thoughts by the readers here before sending them > to core. They're my current wish list :) and here's a few more, for any feedbacks: 1) have load not "necessarily" require the .rb suffix, (i.e. make it behave more like require). Rationale--both load and require are ultimately used to import ruby scripts, Therefore having one be suffix insensitive and the other not is surprising. 2) having "string" + something default to "string" + something.to_s History: when I mentioned this proposal once, Matz said something like "it used to work that way, but it was changed because it hid bugs" I think the reason that it hides bugs is because if the "something" is nil, the concatenation silently concatenated with nothing--you would have hoped it would have raised an exception, but instead you just have strings with mysteriously shorter lengths. (i.e. nil should *not* default to .to_s--this hides bugs) therefore I would propose that string#+ default to string + something.to_s unless that something is nil -- then raise an exception. I just really miss this from java, and dislike having to type in .to_s quite frequently (and I do know you can leverage .to_str for this same effect, I just wish it were default--I'm quite lazy and want to share this "nicety" from java). Thoughts? Thanks! -=r -- Posted via http://www.ruby-forum.com/.