[Prev][Next][Index][Thread]

Re: [Q] Dylan to Java/JVM compiler?



Scott Ribe <scott_ribe@killerbytes.com> writes:

> Yes, but <integer> inherits from <rational> inherits from <real> inherits
> from <complex-number> inherits from <number>, which is *open*. So all the
> "specific" classes are sealed for efficient compilation, but the root of
> that numeric hierarchy is open, allowing for subclassing of <number>. Now
> if you truly need to subclass <integer>, this is not exactly what you
> want. But if you want to add a new numeric type and add methods that
> specialize on it, you can do so.

So the usual operations like + , * etc. are generic
functions. Nice. For historical reasons they aren't in CL. Off course,
in CL they're also variadic and floating point contagion is already
complex enough. Adding user defined numeric types into it probably
wouldn't be worth it.

-- 
Lieven Marchand <mal@wyrd.be>
Glaðr ok reifr skyli gumna hverr, unz sinn bíðr bana.



References: