4 ms·
A Brief Guide to the Common Lisp Object System
- sjolsen 12y agoFor more on CLOS, "Object-Oriented Programming in Common Lisp" is a fun little book. It has some reasonably practical examples and touches on just enough of the system's low-level details. It doesn't have much to say on the Metaobject Protocol, though, and I think for that "The Art of the Metaobject Protocol" is pretty much the standard text.
- wtbob 12y agoAgreed on both recommendations. It's a pity that further standardisation stalled; the MOP would make a good addition.
- samatman 12y agoSeconded, both examples. I get strong impression, working with Lua, that Roberto Ierusalimschy is a devotee of the MOP. Lua in a sense has a MOP but no built-in object system.
- zachbeane 12y agoStarting from classes and describing generic functions as a way to send messages is pretty backwards for CLOS. CLOS is best used primarily by defining a protocol with generic functions, then using methods and (optionally) classes to implement the protocol. http://xach.com/lisp/jrm-clos-guide.html http://xach.com/lisp/jrm-clos-guide.html has a copy of Joe Marshall's "Warp Speed" CLOS guide.
- cousin_it 12y agoA strongly typed version of CLOS generic functions would look a lot like Haskell typeclasses, right?
- PuercoPop 12y agoIIUC, the primary method of the standard-method-combination look's a lot like Haskell Typeclasses. The standard-method-combination has a middleware-like dispatch as shown in here [0]. CL comes with other method-combinations like +, append and you can also define new method combinations. [0]: https://commons.wikimedia.org/wiki/File:Method-combination.png https://commons.wikimedia.org/wiki/File:Method-combination.p...
- cousin_it 12y agoAh, I forgot about before/after/around. That makes sense, thanks!