Book description
This book is the first definitive reference for the Clojure language, providing both an introduction to functional programming in general and a more specific introduction to Clojure's features. This book demonstrates the use of the language through examples, including features such as STM and immutability, which may be new to programmers coming from other languages.
Overview of functional programming and description of what sets Clojure apart from other languages
Detailed explanation of Clojure's special features
Examples of real-world tasks that are well-suited to Clojure's capabilities, starting with simple tasks and moving on to more complex applications
Table of contents
- Copyright
- About the Authors
- About the Technical Reviewer
- Acknowledgments
- 1. The Clojure Way
- 2. The Clojure Environment
- 3. Controlling Program Flow
-
4. Data in Clojure
- 4.1. How to Represent and Manipulate Data
-
4.2. Primitive Types
-
4.2.1. Numbers
-
4.2.1.1. Common Numeric Functions
- 4.2.1.1.1. Addition (+)
- 4.2.1.1.2. Subtraction (–)
- 4.2.1.1.3. Multiplication (*)
- 4.2.1.1.4. Division (/)
- 4.2.1.1.5. inc
- 4.2.1.1.6. dec
- 4.2.1.1.7. quot
- 4.2.1.1.8. rem
- 4.2.1.1.9. min
- 4.2.1.1.10. max
- 4.2.1.1.11. Equals Function (==)
- 4.2.1.1.12. Greater-Than Function (<)
- 4.2.1.1.13. Greater-Than-or-Equals Function (<=)
- 4.2.1.1.14. Less-Than (>)
- 4.2.1.1.15. The Less-Than-or-Equals (>=)
- 4.2.1.1.16. zero?
- 4.2.1.1.17. pos?
- 4.2.1.1.18. neg?
- 4.2.1.1.19. number?
-
4.2.1.1. Common Numeric Functions
- 4.2.2. Strings
- 4.2.3. Boolean
- 4.2.4. Characters
- 4.2.5. Keywords
-
4.2.1. Numbers
- 4.3. Collections
- 4.4. Summary
-
5. Sequences
- 5.1. What Are Sequences?
- 5.2. Anatomy of a Sequence
- 5.3. Constructing Sequences
- 5.4. Lazy Sequences
-
5.5. The Sequence API
-
5.5.1. Sequence Creation
- 5.5.1.1. seq
- 5.5.1.2. vals
- 5.5.1.3. keys
- 5.5.1.4. rseq
- 5.5.1.5. lazy-seq
- 5.5.1.6. repeatedly
- 5.5.1.7. iterate
- 5.5.1.8. repeat
- 5.5.1.9. range
- 5.5.1.10. distinct
- 5.5.1.11. filter
- 5.5.1.12. remove
- 5.5.1.13. cons
- 5.5.1.14. concat
- 5.5.1.15. lazy-cat
- 5.5.1.16. mapcat
- 5.5.1.17. cycle
- 5.5.1.18. interleave
- 5.5.1.19. interpose
- 5.5.1.20. rest
- 5.5.1.21. next
- 5.5.1.22. drop
- 5.5.1.23. drop-while
- 5.5.1.24. take
- 5.5.1.25. take-nth
- 5.5.1.26. take-while
- 5.5.1.27. drop-last
- 5.5.1.28. reverse
- 5.5.1.29. sort
- 5.5.1.30. sort-by
- 5.5.1.31. split-at
- 5.5.1.32. split-with
- 5.5.1.33. partition
- 5.5.1.34. map
-
5.5.1. Sequence Creation
- 5.6. Summary
- 6. State Management
- 7. Namespaces and Libraries
- 8. Metadata
- 9. Multimethods and Hierarchies
-
10. Java Interoperability
- 10.1. Calling Java from Clojure
- 10.2. Calling Clojure from Java
-
10.3. Creating Java Classes
- 10.3.1. Proxying Java Classes
-
10.3.2. Generating Java Classes
- 10.3.2.1. Ahead-of-Time Compilation
- 10.3.2.2. Basic gen-class Options
- 10.3.2.3. Defining Methods for the Generated Class
- 10.3.2.4. Adding State to the Generated Class
- 10.3.2.5. Adding Methods to the Generated Class
- 10.3.2.6. Adding Constructors and Factories
- 10.3.2.7. Exposing Superclass Members
- 10.3.2.8. Generating Command-Line Programs
- 10.3.2.9. Loading the Implementation
- 10.3.2.10. Namespace Declarations with gen-class
- 10.3.2.11. Simple Command-Line Program
- 10.4. Summary
- 11. Parallel Programming
- 12. Macros and Metaprogramming
- 13. Datatypes and Protocols
- 14. Performance
Product information
- Title: Practical Clojure
- Author(s):
- Release date: June 2010
- Publisher(s): Apress
- ISBN: 97814302272311
You might also like
book
Clojure in Action, Second Edition
A fully revised edition that covers the new features available in Clojure 1.6. About the Technology …
book
The Joy of Clojure
The Joy of Clojure goes beyond just syntax to show you how to write fluent and …
book
Quick Clojure: Effective Functional Programming
Get up to speed with Clojure in this quick and practical primer. You'll learn the nuts …
book
Professional Clojure
Clear, practical Clojure for the professional programmer Professional Clojure is the experienced developer's guide to functional …