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

Date archived: April 22, 2019 | First published: December 14, 2010

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.



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java development
ArticleID=600180
ArticleTitle=Solving the Expression Problem with Clojure 1.2
publish-date=12142010