IntelliJ Java IDE
The moose likes Clojure and the fly likes Does Clojure support OOP? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Incubator » Clojure
Reply Bookmark "Does Clojure support OOP?" Watch "Does Clojure support OOP?" New topic
Author

Does Clojure support OOP?

Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3334

Hey,
Since Clojure is a LISP dialect, does this mean that Clojure doesn't support OOP?
Thanks.
Javier Neira
Greenhorn

Joined: Feb 16, 2010
Posts: 5
John Todd wrote:Hey,
Since Clojure is a LISP dialect, does this mean that Clojure doesn't support OOP?
Thanks.


well already there was OOP support in at last Common Lisp:
Clojure interops directly with java and you can code clojure on top of its objects and create new classes and instances.
But i think that would go against the principles of language.
Therefore Clojure have runtime dispatch based on type (like OOP) AND value or metadata with multimethods

An example taken from that link:



And recently have implemented new forms of abstraction taking the good part of the OOP: protocols and datatypes
OOP have good and bad things and Clojure only picks the good ones ;-)
 
 
subject: Does Clojure support OOP?
 
Threads others viewed
Real-life Clojure examples
Joy of Clojure - Questions
State of tool support
IDE support for closure
Scale or Clojure
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture