It didn’t actually take a lot of code, but after spending time studying how keyword arguments work (in Kawa, in DSSSL, in Dylan), I finally got initargs and slot options kind of working in KLOS (Kawa + TinyCLOS).
Here’s a list of things left to do to bring KLOS to parity with Dylan:
Write the macros define-class
and define-method
- the trick here is to implement ensure-generic
, which I think has to be a macro, because it has to expand out to a (define <name> (make <generic> ...))
if the generic has not been defined earlier.
Support the singleton specializer - there’s code to do this in Swindle and also GOOPS, I think.
Support the subclass specializer - this is a specific to Dylan, and I’m looking forward to implementing this, as this is not done anywhere else.
Support default-initargs - this needs to be done as part of define-class
as well. In Dylan, this is called a ‘keyword slot’.
Support specifying a slot’s allocation – there’s code in Swindle and GOOPS that add support for class
allocation, but Dylan also has the each-subclass
allocation, which is nifty and AFAIK unique to Dylan. This feature is not strictly needed because it doesn’t look like it’s used in DUIM or Deuce.
TinyCLOS exposition
I came across this note that goes into the details of TinyCLOS, it’s really great. The test suite is something I should port to Scheme for KLOS.
TELOS, the CLOS MOP for EuLisp
I’ve also been reading the Telosis code, it’s cool to see another approach to bootstrapping the base classes (<object>
, <class>
, <generic>
and <method>
), I’d like to do a deeper comparison between Telosis and TinyCLOS one day.