From: Vincent Fourmond Date: 2007-02-18T07:23:58+09:00 Subject: Re: Oppinions on RCR for dup on immutable classes ara.t.howard@noaa.gov wrote: >> With this in mind, what do you guys think of this work around? >> >>>> [sandal@metta payroll_camping]$ irb >>>> class Object >>>> def dup? >>>> dup >>>> rescue TypeError >>>> false >>>> end >>>> end >> => nil >>>> 3.dup? >> => false >>>> 3.dup? || 3 >> => 3 >>>> "foo".dup? >> => "foo" >> > > same semantics - but nice and clean. +1 -- Vincent Fourmond, PhD student (not for long anymore) http://vincent.fourmond.neuf.fr/