From: Chris Pine Date: 2003-02-02T01:30:43+09:00 Subject: Re: String#+ ----- Original Message ----- Obviously, the "workaround" (print "hi" + 5.to_s) is unsuited for a basic muckaround tutorial, as it is a bit messy. Since you want to demonstrate Ruby's ability to work with various objects, perhaps emphasising the first one (print 'hi', 5) is the way to go. I see nothing particularly wrong with this. ---------------------------- Yes you do (as you mentioned later), and so do I: nobody uses print! Thus, neither does my tutorial. Therefore, I cannot use (puts 'hi', 5) because that outputs two lines. If I use puts, I have to use +. ----- Original Message ----- And yes, I lurve susbstitution :) ---------------------------- Hmmm... perhaps you think I meant String#sub? (I don't that I would have been making sense if I had meant that, though. :) What I meant was inline substitution which does a to_s for you: "hi#{5}" ----- Original Message ----- Perhaps the main message to come out of this is that although there is much in Ruby that recommends it for teaching to utter newbies, that was not in fact the driving principle behind the language. ---------------------------- Nor was it the driving principle behind my request. (Mind you, I am prefectly happy with matz's answer.) If you'll permit the somewhat silly analogy: The fact that this feature would make Ruby easier to learn was a small twig on the fire, as was each time it would have made my life one tiny bit easier. The match was... well, I don't know what the match was... I guess I just got sick of that big stack of twigs and thought it would be cool to finally burn it. :) That's why I only mentioned my tutorial parenthetically, and why I almost didn't put it in at all. Of course ease of teaching was not the driving principle behind Ruby, but surely you don't think it a coincidence? No, it's easy to teach because it is easy to *use*, and that *is* one of the main driving principles behind Ruby, and that's why I brought it up; so it would be easier to use. (I was generating SQL statements at the time.) But if matz says it was tried before and was in fact *harder* to use, then that's the best argument I ever heard! Personally, I hardly ever use numeric addition, so it would only make my life easier. (BTW, I was only suggesting changes to String#+, not any other + methods, which would make + asymmetric in general, but that doesn't bother me.) This is why I didn't realize what a problem it would be for others. 'Nuff said. Chris