There are two superposed problems there 1) let String auto convert to Number when implied in arithmetic 2) let any malformed String asNumber answer zero To my sense, both features: * are not really necessary nor worth * are a source of problems * should better be removed. Nicolas 2010/8/24 Carla F. Griggio <carla.griggio@gmail.com>:
What we've been discussing with Guille is that sometimes the 'type checking' (or actually, the conversion) is done, and sometimes not.
For example:
5 + true
true does not understand 'adaptToNumber:andSend:', so no magic conversion is done, but strings understand that message so we get things like:
5 + 'foo' = 5
This should be consistent regardless the type of the parameter.
Cheers, Carla
On Tue, Aug 24, 2010 at 5:10 PM, Guillermo Polito <guillermopolito@gmail.com> wrote:
Do we reeeeeally want to do
5 + '4'
5 + 'hello'
?
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project