3 ms·
Why was BigInt and FixNum unified into Integer? Don't they already both subclass Integer? It seems they just made it harder to write interfaces that take advan
by vortico 10y ago
Why was BigInt and FixNum unified into Integer? Don't they already both subclass Integer?
It seems they just made it harder to write interfaces that take advantage of machine precision integers. They didn't remove either arbitrary precision integers or machine precision integers, they just made them harder to distinguish. Why is this an improvement?
- riffraff 10y agobecause the existence of Bignum and Fixnum is effectively an implementation detail, Float is now implemented in a similar way for example, without having corresponding Flonum and Bigfloat. There isn't (at least I've never seen it) any reason to distinguish between the two, Fixnum wasn't the proper tool to do machine-precision integer operations either (31 bit).
- vortico 10y agoBut isn't hiding implementation details best done by using an interface (like the Integer superclass) rather than some flag somewhere with branching logic? Fixnum _is_ useful for C extensions to quickly convert to `int`, but now I suppose you don't know whether an Integer is cast-able to an `int` unless you inspect this flag in a new custom way.