From: Stephen White Date: 2001-07-25T15:53:28+09:00 Subject: [ruby-talk:18513] Re: Basic OO Tutorial, Ruby & Perl On Wed, 25 Jul 2001, ts wrote: > def initialize(name = "an unnamed #{self.class} ") > @name = name > end To eliminate the following problem: a = "hello there" b = Horse.new(a) => # a << "elljfeh" b => # This would be better defined as: def initialize(name = "an unnamed #{self.class} ") @name = name.dup end Whether this is worth doing is another question, since there's an awful lot of code out there that just assigns to an instance variable and it doesn't appear to be a problem, strangely enough. -- spwhite@chariot.net.au