Live data from Hacker News

Common Lisp Object System (CLOS)

hescaide.me

1–10 of 90 posts

Re: Common Lisp Object System (CLOS)

#2
Alan Kay’s immortal quote about OOP:

> OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them.

[http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay...]

His reference to ‘LISP’ is, of course, referring to CLOS.

Re: Common Lisp Object System (CLOS)

#5

> I don’t know the exact implementation details of CLOS, but I feel that it can be easily replicated in C This makes me think he's barely scratched the surface of what CLOS has to offer.

“Easily” is a stretch, but with a few Lisp->C idiom translations, you could follow along straightforwardly with “The Art of the Metaobject Protocol”[1].

[1] https://mitpress.mit.edu/9780262610742/the-art-of-the-metaob...

Re: Common Lisp Object System (CLOS)

#6
post #2

Alan Kay’s immortal quote about OOP: > OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them. [ http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay... ] His reference to ‘LISP’ is, of course, referring to C…

And the message idea live on objective c and lisp, but not the other c++ system.

Re: Common Lisp Object System (CLOS)

#7
Meh.. I code in Common Lisp at home and Java professionally and I've never understood why people praise the CLOS so much. Like the author says, 99% of the time you don't have a reason to use OOP, and the few times you do you'd prefer to use as little as possible to keep everything sane. It's also one of the few parts of CL which are not optimized well by default, using structs or other basic data structures instead of objects has visible performance benefits in SBCL if you care about that for some reason.

Yes I'm aware of the things you get in CL you don't get in Java: multiple inheritance, defmethod works on arbitrary types by default rather than having to create interfaces, better introspection.. but I don't care. If you're using these features so much there's probably something overly complex with your code to need to do so. Or you're working in such a complex domain you need to, in which case go ahead..

Re: Common Lisp Object System (CLOS)

#9
One thing bad is the word 'class'. What it is supposed to even mean? It was some fancy concept by stupid Normen when defining Simula. My Simula teacher said that you could just translate it as "design" as in "design of car and its implementation".

Anyways Python's "class" is even worse:

    class c: a=10
    print c.a
    c.a=13
    print c.a
I cannot think any English word to replace the "class". The word I am thinking of could be translated as "box". "Box of things and improved versions of it".

Re: Common Lisp Object System (CLOS)

#10

Meh.. I code in Common Lisp at home and Java professionally and I've never understood why people praise the CLOS so much. Like the author says, 99% of the time you don't have a reason to use OOP, and the few times you do you'd prefer to use as little as possible to keep everything sane. It's also one of the few parts of CL which are not optimized well by default, using structs or other basic data structures instead o…

Agreed. I program in CL and other languages too. I find Java developers tend to have a stronger understanding of OOP and that might be behind your insight. For all its benefits, it feels like at times many CL users miss the point of OOP.

CLOS itself is great, however the decoupling of data and methods is something at times I find leads to harder to understand code.

Post reply on HN