2009/7/8 Andres Valloud <[email protected]>:
> Well, but on the other hand, what happens when you do things like 1.0 +
> NaN or NaN + 1.0? It should work...
>
Sure, it should. What prevents you from implementing it as:
NotANumber>>+ number
^ self
NotANumber>>adaptToNumber: rcvr andSend: selector
selector == #+ ifTrue:[^self].
selector == #* ifTrue:[^self ].
selector == #- ifTrue:[^self ].
selector == #/ ifTrue:[^self].
^super adaptToNumber: rcvr andSend: selector
and so on..
> Igor Stasenko wrote:
>> 2009/7/8 Andres Valloud <[email protected]>:
>>
>>> Would NaN be polymorphic with floats?
>>>
>>>
>> Do you mean , be a part of Number/Float class hierarchy?
>> Answer is: no.
>> Because NotANumber is not a number :)
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Best regards,
Igor Stasenko AKA sig.
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project