Skip to Main Content
Programming Clojure, 3rd Edition
book

Programming Clojure, 3rd Edition

by Alex Miller, Stuart Halloway, Aaron Bedra
February 2018
Intermediate to advanced content levelIntermediate to advanced
304 pages
7h 11m
English
Pragmatic Bookshelf
Content preview from Programming Clojure, 3rd Edition

Creating Java Objects in Clojure

When calling Java libraries or the Java standard library, you’ll often need to pass in Java objects that either implement an interface or extend a particular class. Clojure provides solutions for this problem in several ways—direct use of Java types and interfaces, anonymous interface implementation with reify, and class extension with proxy.

Direct Use of Java Types

Clojure’s implementation reuses Java’s own concrete types like String, Character, Boolean, the numeric classes, Date, and more. Because these Clojure objects are actually Java objects, they can be passed directly to Java APIs without wrapping or modification.

Additionally, many Clojure objects implement key Java interfaces where applicable, so ...

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

Programming Kotlin

Programming Kotlin

Venkat Subramaniam
Getting Clojure

Getting Clojure

Russ Olsen

Publisher Resources

ISBN: 9781680505719Errata Page