From: Paul Lutus Date: 2006-11-30T08:00:09+09:00 Subject: Re: Need a range, but not getting it. . . . ara.t.howard@noaa.gov wrote: > On Thu, 30 Nov 2006, Paul Lutus wrote: > >> >> Because the original example used a string, and yours uses an array, it >> is not a valid counterexample. >> >> Applying ".to_s" to a string has no effect, consequently the receiver is >> changed. Applying ".to_s" to anything other than a string makes a copy. > > i wounn't quite say that. mmap, for example, simply does some pointer > tricks > to return a string. many classes do such things. one should assume only > that to_s returns a string representation of the object, whether or not > it's a copy is class dependant. Okay, I agree, but I limited my remark to a string object getting ".to_s" applied to it, while really, always, has no effect, and returns the original object. And I see I should have said, "applying '.to_s' to anything other than a string usually makes a copy." -- Paul Lutus http://www.arachnoid.com