Is Clojure object-oriented at its heart? (Polymorphism in seqs)

Idiomatic Clojure favors defining independent functions that operate on a very small set of core data structures; this unbundling of methods and data is a strong statement against object orientation and in favour of a functional style. Rich Hickey (creator of Clojure) has repeatedly stated the importance of this; for example here: “Clojure eschews the traditional object-oriented approach of creating a new data type for each new situation, instead preferring to build a large library of functions on a small set of types.”.

The reliance on the core data structures is even more important in Clojure than in other functional languages because you’ll only reap the full benefits from Clojure’s STM when you are using Clojure’s persistent data structures.

I guess a corollary to this question— when can polymorphism be considered distinct from object orientation?

I’m using Clojure’s multimethods (i.e. polymorphic facilities) to dispatch to different implementations based on a filename’s extension – not at all object oriented, but polymorphic.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)