From: "Hal E. Fulton" Date: 2001-02-19T16:08:31+09:00 Subject: [ruby-talk:11083] Re: to_s and << ----- Original Message ----- From: Stephen White To: ruby-talk ML Sent: Sunday, February 18, 2001 9:19 PM Subject: [ruby-talk:11077] Re: to_s and << > > I'm kinda thick, so I have a simpler view... > > Defining 'to_str' for a class means you don't have to bother doing 'to_s' > anymore, when doing string operations. So if you're gonna do a lot of string > operations, then go for it. > > It's also like 'coerce'... you can always do 'a = 1 + 2.4.to_i', but having > a coerce function means you can do 'a = 1 + 2.4' instead. > Now THAT I can understand. That makes more sense to me than anything else I have heard so far. So is this Correct according to other people's views? Hal