From: Gavin Sinclair Date: 2003-02-01T21:41:13+09:00 Subject: Re: String#+ On Saturday, February 1, 2003, 2:51:35 AM, Chris wrote: > Hello, > print 'hi',5 # No problem. > print "hi#{5}"# All good. > print 'hi'+5 # TypeError! > > [...and Chris doesn't like this 'inconsitency'] Hi Chris, I didn't have a real opinion on this before, and I couldn't really be bothered having one now, but I will say this. Given the variety of replies here that support the current behaviour, maybe you need to reconsider the appropriateness of the particular examples in your tutorial. 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. 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. That may or may not be reflected in that fact that I *never* chain arguments with a 'print' statement, and *extremely rarely* even use 'print', preferring 'puts'. And yes, I lurve susbstitution :) (My point: the only time I would use 'print' is if I was writing a tutorial :-) Cheers, Gavin