Hi Chris,
putting messages in Object is never intelligent, at best hackish, and at worse bad style (because of littering and of such un-controlled side effects).
The purpose of my changes was to distinguish comparison from arithmetic:
- for performing arithmetic, exact + inexact lead to an inexact, so it's OK to convert asFloat.
- for performing comparison exact < inexact, you must not convert to inexact or you wll change the relation.
I don't remember what drove me to such high level in hierarchy, but I think that I had to cope with many objects pretending to perform arithmetic (Collection, String, ...).
Or were the original messages already at high level?
We should feel free to revisit anyway!
I don't like implicit conversions when there is no well established bijection.
The example from Tim was excellent: should 1+$1 be 2 or 50?
Why is it different from 1+'1'?
Should we convert Boolean asInteger for cross language (in)convenience?
Should we have true = '1' then?
For me, this is opening a can of worms: a principle of most astonishment.
All those wanting to follow the astonishment path should first lesson once more to:
In the same vein, I hate the null pattern. nil is not false, #() and '' are not false, because empty is not false, 'false' is not true either (though not empty), etc...
These extensions are obscuring the intentions, are equivoque, and are delaying bug finding when un-intentional.
For example, in Matlab relations < and > are defined on complex: you hardly never gonna need that...
except maybe when sorting the eigenvalues of a matrix- and even in this case, you don't want to always use the same ordering,
There is no natural ordering preserving a<b & (c<d) ==> (a+c)<(c+d), so why choose one rather than the other?
The net result is that it is delaying bug finding when you have an unexpected complex result, the program continues and does something, it's just that you don't know exactly what, you lost control...