Solving the Expression Problem with Clojure 1.2

Extend preexisting types to new methods, and preexisting methods to new types

From the developerWorks archives

Stuart Sierra

|

Clojure expert Stuart Sierra introduces you to new features in Clojure 1.2 that solve the Expression Problem, a classic programming dilemma. Protocols let you extend preexisting types to new methods, and datatypes let you extend preexisting methods to new types — all without changing the existing code. You'll also see how Java™ interfaces and classes can interact with Clojure protocols and datatypes.

This content is no longer being updated or maintained. The full article is provided "as is" in a PDF file. Given the rapid evolution of technology, some content, steps, or illustrations may have changed.

View PDF file