June 25, 2007

Classes in the Metaobject Protocol

Dr. Dobb's Portal has republished another classic Lisp article, again by Nick Bourbaki (a pseudonym of Richard Gabriel). It's an introduction to the CLOS Metaobject Protocol which is more technical than others I have read - so may be harder to understand for newbies - but at the same time provides more insight into some of the internal details of the CLOS MOP. Although this is an old article, it's very close to the actual CLOS MOP specification, with only one serious deviation as far as I can tell. The deviation is the fact that slot-value-using-class is specialized on slot names in that article, while they are actually specialized on slot definition metaobjects in the "real" CLOS MOP specification. The reason for this deviation is that for most of the time during the standardization of CLOS and its MOP, slot-value-using-class was indeed supposed to be specialized on slot names (like slot-unbound and slot-missing in ANSI Common Lisp), but that was changed only very late in the game before publication of The Art of the Metaobject Protocol.

Anyway, the information in that article is still valid, so I can recommend it.

No comments: