Hacker News new | ask | show | jobs
by dschiptsov 4879 days ago
Too long. An idea could be stated in a few sentences.)

Java:

This is an instance of an mammal of an animal kingdom which doesn't include dolphins and whales, which has a..., placed within the instance of a class Plain of polymorphic shape which has some private attributes...

ML-family:

This is a member of a set of only mammals of animal kingdom, excluding dolphins and whales, of small size, which has a..., located on the member of a set of geometric figures....

Lisp:

The cat sat on the mat.

3 comments

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].

>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).

This metaphor can be the new "how programming language X shoots yourself in the foot." (http://www.toodarkpark.org/computers/humor/shoot-self-in-foo...)

I would love to see how C/C++/ObjC would also express a feline upon a fabric.

Lisp:

(sat(mat preposition(article 'cat ('the))))

(sat cat (on mat))