Hacker News new | ask | show | jobs
by arethuza 4879 days ago
Well, with CLOS you really define your verb behaviour on tuples of nouns (methods) and the verbs (generic functions) are separate and you can, if you want, get as creative as you want as to how your methods get invoked by your generic functions.

[Mind you, it's been a while since I developed in CLOS, so apologies in advance if this is incorrect].

2 comments

>Well, with CLOS you really define your verb behaviour on tuples of nouns (methods) and the verbs (generic functions) are separate

You can do this in any OO language as well: with multi-dispatch patterns. What makes CLOS so powerful is that you can do multi-dispatch without resorting to things like the visitor patters. Simply write what you mean with no boilerplate.

CLOS is really required in about 5% of very specialized tasks, such as simulations.
I'm not sure - "simple" CLOS is really pretty simple and arguably works in a more intuitive way than most OO environments. However, if you do want more sophistication, as with most of Lisp, taking the Red Pill of the MOP can take you as deep as you want to go....

[Damn - I really need to do some more Lisp development]

I would agree with this... basic defgeneric/defmethod/defclass work is straightforward. It's when you start with the advice partial methods and the MOP that things get... exotic.

(I read the AMOP earlier this year and I'm pretty sure I haven't recovered from that mind bender).