On Mon, 12 Jan 2004 13:05:27 +0100 David Ayers <address@hidden> wrote:
>| Acutally I agree with Adam. NSNumber should allow *any* custom
>| subclasses "to do the right thing". These aren't primiative methods.
>| So therefor these look like bugs in the NSNumber implementation to me.
>| I think all these numberWith*: methods should test:
>| if (self == [NSNumber class] || self == [applicableConcreteClass class])
>| (or rather the cached versions) before executing their current
>| implementations using the NSAllocateObject function. Otherwise it
>| should probaly just call [[self alloc] initWith*:] as you have done.
OK. Should we test against NSNumber class only or also against NSDoubleNumber,
NSShortNumber, ... for cases like:
[NSDoubleNumber numberWithDouble:xx] ? As far as I remember, NSDoubleNumber,...
are no more declared as public. So I'm
not sure this is a real problem....
BTW, as I've got another problem, what is the correct way to test if a NSNumber
is a NSDoubleNumber or a NSFloatNumber,...
before recent changes, we were able to use isKindOfClass:[NSDoubleNumber
class] ? It's interesting to know the kind of
data and use appropriate methods to keep precision