From: Anders Borch Date: 2004-03-15T05:04:35+09:00 Subject: Re: float allocator Robert Klemme wrote: >>I did a bit of testing and found out that neither Fixnum, Float or >>Bignum can be dup'ed. Is this intentional, and if so then how do I go >>about copying the descendents of Numeric? > > > You don't. You gain nothing by dup'ing Integer, Float etc. because these > are immutable anyway. You don't gain anything by copying these. My code is dup'ing objects without knowing what type they are, the great thing would be to be able to use the same code on my numerics as the code I can use on all other objects. > OTOH, for a uniform invocation these instance's #dup methods could be > defined to return self. This should let me use my code unchanged from ruby 1.6 to 1.8. Thanks :) > Regards > > robert > -- dc -e 4dd*od3*dddn1-89danrn10-dan3+ann6*dan*2*an13dn1+dn2-dn3+5*ddan2/9+an13nap