Hi, On Feb 11, 1:46 pm, HB <hubaghd...@gmail.com> wrote: > Since Clojure is a LISP dialect, does this mean that it doesn't > support OOP?
Careful not to come to the conclusion that if something's a Lisp, it's not OOP. For instance, Common Lisp has a powerful OOP system which includes multiple-inheritance, metaobject protocol, and so forth. http://en.wikipedia.org/wiki/Common_Lisp_Object_System The world is a bit upside-down. I suspect people would look at me strangely if I claimed that C++ wasn't seriously OOPish. However, Alan Kay claimed: "Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind." -- http://video.google.com/videoplay?docid=-2950949730059754521 ... and later in that video strongly regrets coining the term, as it gives the wrong impression. OOP is a term which can mean many (even conflicing?) things, as Jonathan Rees discussed: http://www.paulgraham.com/reesoo.html As for Clojure, Rich Hickey claims it's not OOP. I guess he means this: Instead of modelling me as an object whose internal state changes as I change (from moment to moment), you instead model me as a reference which points to a different immutable value as I change. That is, I'm a different person from the one a few seconds ago; just that my identity points to the most recent version of me. (As a software optimization, those immutable versions may share significant structure.) This means that if you took a snapshot of me (an immutable value), that snapshot won't change. You'll just have an old version of me. But in a traditional OOP language, if you had a pointer to my object, that object could be updated willy-nilly by other threads; you'd need to make a threadsafe deep copy of me or something, to have an immutable snapshot. I hope I grok the Clojure Way well enough that my explanation is right. http://clojure.org/state Incidentally, you could create your own OOP system on top of Clojure, if you wish. All the best, Tayssir -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en