
Clojure for the Brave and True
Learn the Ultimate Language and Become a Better Programmer
Daniel Higginbotham(Author)
No Starch Press
Published on 15. October 2015
328 pages
978-1-59327-723-9 (ISBN)
System requirements
for ePUB without DRM
E-Book Single Licence
You are acquiring a single user licence for this eBook, which you might not transfer. [L]
Available for download
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
For weeks, months—nay!—from the very moment you were born, you've felt it calling to you. At long last you'll be united with the programming language you've been longing for: Clojure!
As a Lisp-style functional programming language, Clojure lets you write robust and elegant code, and because it runs on the Java Virtual Machine, you can take advantage of the vast Java ecosystem. Clojure for the Brave and True offers a "dessert-first" approach: you'll start playing with real programs immediately, as you steadily acclimate to the abstract but powerful features of Lisp and functional programming. Inside you'll find an offbeat, practical guide to Clojure, filled with quirky sample programs that catch cheese thieves and track glittery vampires.
Learn how to:
-Wield Clojure's core functions
-Use Emacs for Clojure development
-Write macros to modify Clojure itself
-Use Clojure's tools to simplify concurrency and parallel programming
Clojure for the Brave and True assumes no prior experience with Clojure, the Java Virtual Machine, or functional programming. Are you ready, brave reader, to meet your true destiny? Grab your best pair of parentheses—you're about to embark on an epic journey into the world of Clojure!
More details
Language
English
Place of publication
New York
United States
Product notice
Reflowable
File size
20,26 MB
ISBN-13
978-1-59327-723-9 (9781593277239)
Schweitzer Classification
Other editions
Additional editions

Daniel Higginbotham
Clojure for the Brave and True
Learn the Ultimate Language and Become a Better Programmer
Book
10/2015
1st Edition
No Starch Press
€56.00
Article not available at the moment
Person
Daniel Higginbotham has been a professional programmer for eleven years, half of that at McKinsey & Company, where he used Clojure to build mobile and web applications. He has also contributed to the curriculum for ClojureBridge, an organization that offers free, beginner-friendly Clojure workshops for women. Daniel blogs about programming and life at http://www.flyingmachinestudios.com, and can be found on Twitter, @nonrecursive. He lives in Durham, North Carolina, with his wife and four cats.
Content
- Cover Page
- Title Page
- Copyright Page
- About the Author
- About the Technical Reviewer
- Dedication
- Brief Contents
- Contents in Detail
- Foreword
- Acknowledgments
- Introduction
- Learning a New Programming Language: A Journey Through the Four Labyrinths
- How This Book Is Organized
- Part I: Environment Setup
- Part II: Language Fundamentals
- Part III: Advanced Topics
- The Code
- The Journey Begins!
- Part I: Environment Setup
- Chapter 1: Building, Running, and the REPL
- First Things First: What Is Clojure?
- Leiningen
- Creating a New Clojure Project
- Running the Clojure Project
- Building the Clojure Project
- Using the REPL
- Clojure Editors
- Summary
- Chapter 2: How to Use Emacs, an Excellent Clojure Editor
- Installation
- Configuration
- Emacs Escape Hatch
- Emacs Buffers
- Working with Files
- Key Bindings and Modes
- Emacs Is a Lisp Interpreter
- Modes
- Installing Packages
- Core Editing Terminology and Key Bindings
- Point
- Movement
- Selection with Regions
- Killing and the Kill Ring
- Editing and Help
- Using Emacs with Clojure
- Fire Up Your REPL!
- Interlude: Emacs Windows and Frames
- A Cornucopia of Useful Key Bindings
- How to Handle Errors
- Paredit
- Wrapping and Slurping
- Barfing
- Navigation
- Continue Learning
- Summary
- Part II: Language Fundamentals
- Chapter 3: Do Things: A Clojure Crash Course
- Syntax
- Forms
- Control Flow
- if
- do
- when
- nil, true, false, Truthiness, Equality, and Boolean Expressions
- Naming Values with def
- Data Structures
- Numbers
- Strings
- Maps
- Keywords
- Vectors
- Lists
- Sets
- Simplicity
- Functions
- Calling Functions
- Function Calls, Macro Calls, and Special Forms
- Defining Functions
- The Docstring
- Parameters and Arity
- Destructuring
- Function Body
- All Functions Are Created Equal
- Anonymous Functions
- Returning Functions
- Pulling It All Together
- The Shire's Next Top Model
- let
- loop
- Regular Expressions
- Symmetrizer
- Better Symmetrizer with reduce
- Hobbit Violence
- Summary
- Exercises
- Chapter 4: Core Functions in Depth
- Programming to Abstractions
- Treating Lists, Vectors, Sets, and Maps as Sequences
- first, rest, and cons
- Abstraction Through Indirection
- Seq Function Examples
- map
- reduce
- take, drop, take-while, and drop-while
- filter and some
- sort and sort-by
- concat
- Lazy Seqs
- Demonstrating Lazy Seq Efficiency
- Infinite Sequences
- The Collection Abstraction
- into
- conj
- Function Functions
- apply
- partial
- complement
- A Vampire Data Analysis Program for the FWPD
- Summary
- Exercises
- Chapter 5: Functional Programming
- Pure Functions: What and Why
- Pure Functions Are Referentially Transparent
- Pure Functions Have No Side Effects
- Living with Immutable Data Structures
- Recursion Instead of for/while
- Function Composition Instead of Attribute Mutation
- Cool Things to Do with Pure Functions
- comp
- memoize
- Peg Thing
- Playing
- Code Organization
- Creating the Board
- Moving Pegs
- Rendering and Printing the Board
- Player Interaction
- Summary
- Exercises
- Chapter 6: Organizing Your Project: A Librarian's Tale
- Your Project as a Library
- Storing Objects with def
- Creating and Switching to Namespaces
- refer
- alias
- Real Project Organization
- The Relationship Between File Paths and Namespace Names
- Requiring and Using Namespaces
- The ns Macro
- To Catch a Burglar
- Summary
- Chapter 7: Clojure Alchemy: Reading, Evaluation, and Macros
- An Overview of Clojure's Evaluation Model
- The Reader
- Reading
- Reader Macros
- The Evaluator
- These Things Evaluate to Themselves
- Symbols
- Lists
- Function Calls
- Special Forms
- Macros
- Syntactic Abstraction and the -& Macro
- Summary
- Exercises
- Chapter 8: Writing Macros
- Macros Are Essential
- Anatomy of a Macro
- Building Lists for Evaluation
- Distinguishing Symbols and Values
- Simple Quoting
- Syntax Quoting
- Using Syntax Quoting in a Macro
- Refactoring a Macro and Unquote Splicing
- Things to Watch Out For
- Variable Capture
- Double Evaluation
- Macros All the Way Down
- Brews for the Brave and True
- Validation Functions
- if-valid
- Summary
- Exercises
- Part III: Advanced Topics
- Chapter 9: The Sacred Art of Concurrent and Parallel Programming
- Concurrency and Parallelism Concepts
- Managing Multiple Tasks vs. Executing Tasks Simultaneously
- Blocking and Asynchronous Tasks
- Concurrent Programming and Parallel Programming
- Clojure Implementation: JVM Threads
- What's a Thread?
- The Three Goblins: Reference Cells, Mutual Exclusion, and Dwarven Berserkers
- Futures, Delays, and Promises
- Futures
- Delays
- Promises
- Rolling Your Own Queue
- Summary
- Exercises
- Chapter 10: Clojure Metaphysics: Atoms, Refs, Vars, and Cuddle Zombies
- Object-Oriented Metaphysics
- Clojure Metaphysics
- Atoms
- Watches and Validators
- Watches
- Validators
- Refs
- Modeling Sock Transfers
- commute
- Vars
- Dynamic Binding
- Creating and Binding Dynamic Vars
- Dynamic Var Uses
- Per-Thread Binding
- Altering the Var Root
- Stateless Concurrency and Parallelism with pmap
- Summary
- Exercises
- Chapter 11: Mastering Concurrent Processes with core.async
- Getting Started with Processes
- Buffering
- Blocking and Parking
- thread
- The Hot Dog Machine Process You've Been Longing For
- alts!!
- Queues
- Escape Callback Hell with Process Pipelines
- Additional Resources
- Summary
- Chapter 12: Working with the JVM
- The JVM
- Writing, Compiling, and Running a Java Program
- Object-Oriented Programming in the World's Tiniest Nutshell
- Ahoy, World
- Packages and Imports
- JAR Files
- clojure.jar
- Clojure App JARs
- Java Interop
- Interop Syntax
- Creating and Mutating Objects
- Importing
- Commonly Used Java Classes
- The System Class
- The Date Class
- Files and Input/Output
- Resources
- Summary
- Chapter 13: Creating and Extending Abstractions with Multimethods, Protocols, and Records
- Polymorphism
- Multimethods
- Protocols
- Records
- Further Study
- Summary
- Exercises
- Appendix A: Building and Developing with Leiningen
- The Artifact Ecosystem
- Identification
- Dependencies
- Plug-Ins
- Summary
- Appendix B: Boot, the Fancy Clojure Build Framework
- Boot's Abstractions
- Tasks
- The REPL
- Composition and Coordination
- Handlers and Middleware
- Tasks Are Middleware Factories
- Filesets
- Next Steps
- Farewell!
- Index
- Footnote
- Chapter 2: How to Use Emacs, an Excellent Clojure Editor
- Resources
System requirements
File format: ePUB
Copy protection: without DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Use a reader that can handle the file format ePUB, such as Adobe Digital Editions or FBReader – both free (see eBook Help).
- Tablet/Smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePUB works well for novels and non-fiction books – i.e., 'flowing' text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook does not use copy protection or Digital Rights Management
For more information, see our eBook Help page.