• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Does Clojure support OOP?

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,
Since Clojure is a LISP dialect, does this mean that Clojure doesn't support OOP?
Thanks.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ;-)
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic