Skip to Main Content
The Joy of Clojure, Second Edition
book

The Joy of Clojure, Second Edition

by Michael Fogus, Chris Houser
May 2014
Intermediate to advanced content levelIntermediate to advanced
520 pages
17h 23m
English
Manning Publications
Content preview from The Joy of Clojure, Second Edition

Chapter 9. Combining data and code

This chapter covers

  • Namespaces
  • Exploring Clojure multimethods with the Universal Design Pattern
  • Types, protocols, and records
  • A fluent builder for chess moves

Clojure provides powerful features for grouping and partitioning logical units of code and data. Most logical groupings occur in namespaces, Clojure’s analogue to Java packages. We explore how to build, manipulate, and reason about them. Also, in this chapter we’ll play with Clojure’s powerful multimethods that provide polymorphism based on arbitrary dispatch functions. We’ll then uncover recent additions to Clojure supporting abstraction-oriented programming—types, protocols, and records. Finally, the chapter concludes with the creation of a fluent ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Living Clojure

Living Clojure

Carin Meier
Clojure in Action, Second Edition

Clojure in Action, Second Edition

Amit Rathore, Francis Avila
Getting Clojure

Getting Clojure

Russ Olsen
Programming Clojure, 3rd Edition

Programming Clojure, 3rd Edition

Alex Miller, Stuart Halloway, Aaron Bedra

Publisher Resources

ISBN: 9781617291418Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link