On Apr 11, 2006, at 21:30, Nicholas Clark wrote:
I can see value in a type .Number, which changes internal
representation and
vtable as and when necessary, but I'd still expect it to report
"Number"
when asked what type it is
[ ... ]
Was this built in morphing the cause of the problems Leo was
describing in
trying to make a user defined class that is derived from Int?
Exactly. A method, being it vtable, NCI (aka METHOD PMC* exp()), or MMD
dispatches on the type number(s) of the PMC(s). Whenever the type
number changes, strange things start happening. This gets worse, when
inheritance is involved too.
Changing the type name e.g. 'Integer' -> 'BigInt' is just the visible
effect of it, but of course as undesirable as broken method dispatch.
Before proposing any solution, we still have to clarify, what our
(scalar) PMCs really are. But I see light at the end of the tunnel.
Nicholas Clark
leo