Ignoring implementation / value encoding differences, though, if we compare
integers and floats, we see that they have similar interfaces and behaviour.
By this I mean [largely] the same arithmetic operations apply to each, and
they each used in the same way: to represent numeric values. Furthermore,
floats can represent all integer values [I'm assuming a C model here], thus
could considered a 'specialisation' of integers, though of course, the
interface differences would preclude their being considered to be in a
superclass / subclass relationship, as you point out.
You've pointed out that the restricted domain of C ints makes type promotion reasonable. I'm okay with that; we do agree that the differences between floats and ints would make type promotion a bad idea for Mozart, or indeed for any language with implicit bigints vs floats. Fixed-point decimals might be a different matter, of course; it seems to me you could treat *those* as a superclass of ints without any problem. Unfortunately I don't know of any languages but SQL that have them, but they seem so much more intuitive than floats.
Max Wilson
--
Be pretty if you are,
Be witty if you can,
But be cheerful if it kills you.
_________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
