Gift Guide

Clojure Cookbook: Recipes for Functional Programming

( 1 )


With more than 150 detailed recipes, this cookbook shows experienced Clojure developers how to solve a variety of programming tasks with this JVM language. The solutions cover everything from building dynamic websites and working with databases to network communication, cloud computing, and advanced testing strategies. And more than 60 of the world’s best Clojurians contributed recipes.

Each recipe includes code that you can use right away, along with a discussion on how and why...

See more details below
$32.28 price
(Save 28%)$44.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Paperback)
  • All (17) from $17.99   
  • New (13) from $23.39   
  • Used (4) from $17.99   
Clojure Cookbook: Recipes for Functional Programming

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$19.99 price
(Save 44%)$35.99 List Price


With more than 150 detailed recipes, this cookbook shows experienced Clojure developers how to solve a variety of programming tasks with this JVM language. The solutions cover everything from building dynamic websites and working with databases to network communication, cloud computing, and advanced testing strategies. And more than 60 of the world’s best Clojurians contributed recipes.

Each recipe includes code that you can use right away, along with a discussion on how and why the solution works, so you can adapt these patterns, approaches, and techniques to situations not specifically covered in this cookbook.

  • Master built-in primitive and composite data structures
  • Create, develop and publish libraries, using the Leiningen tool
  • Interact with the local computer that’s running your application
  • Manage network communication protocols and libraries
  • Use techniques for connecting to and using a variety of databases
  • Build and maintain dynamic websites, using the Ring HTTP server library
  • Tackle application tasks such as packaging, distributing, profiling, and logging
  • Take on cloud computing and heavyweight distributed data crunching
  • Dive into unit, integration, simulation, and property-based testing
Clojure Cookbook is a collaborative project with contributions from some of the world’s best Clojurians, whose backgrounds range from aerospace to social media, banking to robotics, AI research to e-commerce.
Read More Show Less

Product Details

  • ISBN-13: 9781449366179
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 3/31/2014
  • Edition number: 1
  • Pages: 476
  • Sales rank: 775,708
  • Product dimensions: 6.90 (w) x 9.10 (h) x 1.10 (d)

Meet the Author

Luke VanderHart is a Clojure/ClojureScript developer, a member of Clojure/core, and a co-author of Practical Clojure (Apress, 2010). Luke lives in Maryland.

Ryan Neufeld is an experienced software developer with Relevance, Inc. Although a first-time author, Ryan has worked at a number of established startups.

Read More Show Less

Table of Contents

How This Book Was Written;
Other Resources;
Software Prerequisites;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Chapter 1: Primitive Data;
1.1 Introduction;
1.2 Changing the Capitalization of a String;
1.3 Cleaning Up Whitespace in a String;
1.4 Building a String from Parts;
1.5 Treating a String as a Sequence of Characters;
1.6 Converting Between Characters and Integers;
1.7 Formatting Strings;
1.8 Searching a String by Pattern;
1.9 Pulling Values Out of a String Using Regular Expressions;
1.10 Performing Find and Replace on Strings;
1.11 Splitting a String into Parts;
1.12 Pluralizing Strings Based on a Quantity;
1.13 Converting Between Strings, Symbols, and Keywords;
1.14 Maintaining Accuracy with Extremely Large/Small Numbers;
1.15 Working with Rational Numbers;
1.16 Parsing Numbers;
1.17 Truncating and Rounding Numbers;
1.18 Performing Fuzzy Comparison;
1.19 Performing Trigonometry;
1.20 Inputting and Outputting Integers with Different Bases;
1.21 Calculating Statistics on Collections of Numbers;
1.22 Performing Bitwise Operations;
1.23 Generating Random Numbers;
1.24 Working with Currency;
1.25 Generating Unique IDs;
1.26 Obtaining the Current Date and Time;
1.27 Representing Dates as Literals;
1.28 Parsing Dates and Times Using clj-time;
1.29 Formatting Dates Using clj-time;
1.30 Comparing Dates;
1.31 Calculating the Length of a Time Interval;
1.32 Generating Ranges of Dates and Times;
1.33 Generating Ranges of Dates and Times Using Native Java Types;
1.34 Retrieving Dates Relative to One Another;
1.35 Working with Time Zones;
1.36 Converting a Unix Timestamp to a Date;
1.37 Converting a Date to a Unix Timestamp;
Chapter 2: Composite Data;
2.1 Introduction;
2.2 Creating a List;
2.3 Creating a List from an Existing Data Structure;
2.4 "Adding" an Item to a List;
2.5 "Removing" an Item from a List;
2.6 Testing for a List;
2.7 Creating a Vector;
2.8 "Adding" an Item to a Vector;
2.9 "Removing" an Item from a Vector;
2.10 Getting the Value at an Index;
2.11 Setting the Value at an Index;
2.12 Creating a Set;
2.13 Adding and Removing Items from Sets;
2.14 Testing Set Membership;
2.15 Using Set Operations;
2.16 Creating a Map;
2.17 Retrieving Values from a Map;
2.18 Retrieving Multiple Keys from a Map Simultaneously;
2.19 Setting Keys in a Map;
2.20 Using Composite Values as Map Keys;
2.21 Treating Maps as Sequences (and Vice Versa);
2.22 Applying Functions to Maps;
2.23 Keeping Multiple Values for a Key;
2.24 Combining Maps;
2.25 Comparing and Sorting Values;
2.26 Removing Duplicate Elements from a Collection;
2.27 Determining if a Collection Holds One of Several Values;
2.28 Implementing Custom Data Structures: Red-Black Trees—Part I;
2.29 Implementing Custom Data Structures: Red-Black Trees—Part II;
Chapter 3: General Computing;
3.1 Introduction;
3.2 Running a Minimal Clojure REPL;
3.3 Interactive Documentation;
3.4 Exploring Namespaces;
3.5 Trying a Library Without Explicit Dependencies;
3.6 Running Clojure Programs;
3.7 Running Programs from the Command Line;
3.8 Parsing Command-Line Arguments;
3.9 Creating Custom Project Templates;
3.10 Building Functions with Polymorphic Behavior;
3.11 Extending a Built-In Type;
3.12 Decoupling Consumers and Producers with core.async;
3.13 Making a Parser for Clojure Expressions Using core.match;
3.14 Querying Hierarchical Graphs with core.logic;
3.15 Playing a Nursery Rhyme;
Chapter 4: Local I/O;
4.1 Introduction;
4.2 Writing to STDOUT and STDERR;
4.3 Reading a Single Keystroke from the Console;
4.4 Executing System Commands;
4.5 Accessing Resource Files;
4.6 Copying Files;
4.7 Deleting Files or Directories;
4.8 Listing Files in a Directory;
4.9 Memory Mapping a File;
4.10 Reading and Writing Text Files;
4.11 Using Temporary Files;
4.12 Reading and Writing Files at Arbitrary Positions;
4.13 Parallelizing File Processing;
4.14 Parallelizing File Processing with Reducers;
4.15 Reading and Writing Clojure Data;
4.16 Using edn for Configuration Files;
4.17 Emitting Records as edn Values;
4.18 Handling Unknown Tagged Literals When Reading Clojure Data;
4.19 Reading Properties from a File;
4.20 Reading and Writing Binary Files;
4.21 Reading and Writing CSV Data;
4.22 Reading and Writing Compressed Files;
4.23 Working with XML Data;
4.24 Reading and Writing JSON Data;
4.25 Generating PDF Files;
4.26 Making a GUI Window with Scrollable Text;
Chapter 5: Network I/O and Web Services;
5.1 Introduction;
5.2 Making HTTP Requests;
5.3 Performing Asynchronous HTTP Requests;
5.4 Sending a Ping Request;
5.5 Retrieving and Parsing RSS Data;
5.6 Sending Email;
5.7 Communicating over Queues Using RabbitMQ;
5.8 Communicating with Embedded Devices via MQTT;
5.9 Using ZeroMQ Concurrently;
5.10 Creating a TCP Client;
5.11 Creating a TCP Server;
5.12 Sending and Receiving UDP Packets;
Chapter 6: Databases;
6.1 Introduction;
6.2 Connecting to an SQL Database;
6.3 Connecting to an SQL Database with a Connection Pool;
6.4 Manipulating an SQL Database;
6.5 Simplifying SQL with Korma;
6.6 Performing Full-Text Search with Lucene;
6.7 Indexing Data with ElasticSearch;
6.8 Working with Cassandra;
6.9 Working with MongoDB;
6.10 Working with Redis;
6.11 Connecting to a Datomic Database;
6.12 Defining a Schema for a Datomic Database;
6.13 Writing Data to Datomic;
6.14 Removing Data from a Datomic Database;
6.15 Trying Datomic Transactions Without Committing Them;
6.16 Traversing Datomic Indexes;
Chapter 7: Web Applications;
7.1 Introduction;
7.2 Introduction to Ring;
7.3 Using Ring Middleware;
7.4 Serving Static Files with Ring;
7.5 Handling Form Data with Ring;
7.6 Handling Cookies with Ring;
7.7 Storing Sessions with Ring;
7.8 Reading and Writing Request and Response Headers in Ring;
7.9 Routing Requests with Compojure;
7.10 Performing HTTP Redirects with Ring;
7.11 Building a RESTful Application with Liberator;
7.12 Templating HTML with Enlive;
7.13 Templating with Selmer;
7.14 Templating with Hiccup;
7.15 Rendering Markdown Documents;
7.16 Building Applications with Luminus;
Chapter 8: Performance and Production;
8.1 Introduction;
8.2 AOT Compilation;
8.3 Packaging a Project into a JAR File;
8.4 Creating a WAR File;
8.5 Running an Application as a Daemon;
8.6 Alleviating Performance Problems with Type Hinting;
8.7 Fast Math with Primitive Java Arrays;
8.8 Simple Profiling with Timbre;
8.9 Logging with Timbre;
8.10 Releasing a Library to Clojars;
8.11 Using Macros to Simplify API Deprecations;
Chapter 9: Distributed Computation;
9.1 Introduction;
9.2 Building an Activity Feed System with Storm;
9.3 Processing Data with an Extract Transform Load (ETL) Pipeline;
9.4 Aggregating Large Files;
9.5 Testing Cascalog Workflows;
9.6 Checkpointing Cascalog Jobs;
9.7 Explaining a Cascalog Query;
9.8 Running a Cascalog Job on Elastic MapReduce;
Chapter 10: Testing;
10.1 Introduction;
10.2 Unit Testing;
10.3 Testing with Midje;
10.4 Thoroughly Testing by Randomizing Inputs;
10.5 Finding Values That Cause Failure;
10.6 Running Browser-Based Tests;
10.7 Tracing Code Execution;
10.8 Avoiding Null-Pointer Exceptions with core.typed;
10.9 Verifying Java Interop Using core.typed;
10.10 Type Checking Higher-Order Functions with core.typed;
Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted May 28, 2014

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)