Clojure for Java Developers

Transition smoothly from Java to the most widely used functional JVM-based language – Clojure

Clojure for Java Developers

This ebook is included in a Mapt subscription
Eduardo Díaz

Transition smoothly from Java to the most widely used functional JVM-based language – Clojure
$0.00
$27.99
$34.99
$29.99p/m after trial
RRP $27.99
RRP $34.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785281501
Paperback156 pages

Book Description

We have reached a point where machines are not getting much faster, software projects need to be delivered quickly, and high quality in software is more demanding as ever.

We need to explore new ways of writing software that helps achieve those goals. Clojure offers a new possibility of writing high quality, multi-core software faster than ever, without having to leave your current platform.

Clojure for Java developers aims at unleashing the true potential of the Clojure language to use it in your projects. The book begins with the installation and setup of the Clojure environment before moving on to explore the language in-depth. Get acquainted with its various features such as functional programming, concurrency, etc. with the help of example projects. Additionally, you will also, learn how the tooling works, and how it interacts with the Java environment.

By the end of this book, you will have a firm grip on Clojure and its features, and use them effectively to write more robust programs.

Table of Contents

Chapter 1: Getting Started with Clojure
Getting to know Clojure
Installing Leiningen
Using a REPL
Creating a new project
Using Cursive Clojure
Getting started with Clojure code and data
Clojure's data types
Summary
Chapter 2: Namespaces, Packages, and Tests
Namespaces in Clojure
The classpath and the classloader
Testing in Clojure
Summary
Chapter 3: Interacting with Java
Using Maven dependencies
Clojure interop syntax
Writing a simple image namespace
Writing the tests
Destructuring in Clojure
Exposing your code to Java
Proxy and reify
Summary
Chapter 4: Collections and Functional Programming
Basics of functional programming
Persistent collections
Types of collections in Clojure
The sequence abstraction
Specific collection types in Clojure
Summary
Chapter 5: Multimethods and Protocols
Polymorphism in Java
Multimethods in Clojure
Protocols in Clojure
Summary
Chapter 6: Concurrency
Using your Java knowledge
The Clojure model of state and identity
Promises
Futures
Software transactional memory and refs
Atoms
Agents
core.async
Summary
Chapter 7: Macros in Clojure
Lisp's foundational ideas
Macros as code modification tools
Writing your first macro
Debugging your first macro
Macros in the real world
References
Summary

What You Will Learn

  • Understand the tools for the Clojure world and how they relate to Java tools and standards (like Maven)
  • Learn about immutable data structures, and what makes them feasible for everyday programming
  • Write simple multi-core programs using Clojure’s core concepts, like atoms, agents and refs
  • Understand that in Clojure, code is data, and how to take advantage of that fact by generating and manipulating code with macros
  • Learn how Clojure interacts with Java, how the class loaders work and how to use Clojure from Java or the other way around
  • Discover a new, more flexible meaning of polymorphism and understand that OOP is not the only way to get it

Authors

Table of Contents

Chapter 1: Getting Started with Clojure
Getting to know Clojure
Installing Leiningen
Using a REPL
Creating a new project
Using Cursive Clojure
Getting started with Clojure code and data
Clojure's data types
Summary
Chapter 2: Namespaces, Packages, and Tests
Namespaces in Clojure
The classpath and the classloader
Testing in Clojure
Summary
Chapter 3: Interacting with Java
Using Maven dependencies
Clojure interop syntax
Writing a simple image namespace
Writing the tests
Destructuring in Clojure
Exposing your code to Java
Proxy and reify
Summary
Chapter 4: Collections and Functional Programming
Basics of functional programming
Persistent collections
Types of collections in Clojure
The sequence abstraction
Specific collection types in Clojure
Summary
Chapter 5: Multimethods and Protocols
Polymorphism in Java
Multimethods in Clojure
Protocols in Clojure
Summary
Chapter 6: Concurrency
Using your Java knowledge
The Clojure model of state and identity
Promises
Futures
Software transactional memory and refs
Atoms
Agents
core.async
Summary
Chapter 7: Macros in Clojure
Lisp's foundational ideas
Macros as code modification tools
Writing your first macro
Debugging your first macro
Macros in the real world
References
Summary

Book Details

ISBN 139781785281501
Paperback156 pages
Read More

Read More Reviews