- ;; Slightly tricky. We don't necessarily want a pointer to the metaclass,
- ;; but to its most specific subclass on the given chain. Fortunately, CL
- ;; is good at this game.
- (let* ((meta-chains (sod-class-chains metaclass))
- (meta-chain-tails (mapcar #'car meta-chains))
- (meta-chain-tail (find meta-chain-head meta-chain-tails
- :key #'sod-class-chain-head)))
+ ;; Rather tricky. This is a class pointer on a vtable for the CHAIN-HEAD
+ ;; chain, pointing into the META-CHAIN-HEAD chain of the metaclass. We
+ ;; need to produce a pointer to the most specific superclass of the
+ ;; metaclass on the right chain that is a superclass of the metaclass of
+ ;; the most specific class in the superclass chain headed by CHAIN-HEAD.
+ (flet ((chain-tail (class head)
+ (find head (mapcar #'car (sod-class-chains class))
+ :key #'sod-class-chain-head)))