Cover of Mastering Clojure Macros: Write Cleaner, Faster, Smarter Code

Mastering Clojure Macros: Write Cleaner, Faster, Smarter Code

Level up your skills by taking advantage of Clojure's powerful macro system. Macros make hard things possible and normal things easy. They can be tricky to use, and this book will help you deftly navigate the terrain. You'll discover how to write straightforward code that avoids duplication and clarifies your intentions. You'll learn how and why to write macros. You'll learn to recognize situations when using a macro would (and wouldn't!) be helpful. And you'll use macros to remove unnecessary code and build new language features.Clojure offers some sharp tools in its toolbox, and one of the sharpest is its macro system. This book will help you write macros using Clojure, and more importantly, recognize when you should be using macros in the first place.The Lisp "code-as-data" philosophy gives tremendous advantages to macro authors and users. You can use macros to evaluate code in other contexts, move computations to compile time, and create beautiful API layers. You don't need to wait on the Clojure language itself to add new features, you'll learn how to implement even the lowest-level features as macros. You'll step through representative samples of how to use macros in production libraries and applications, find clear details on how to construct macros, and learn pointers to avoid obstacles that often trip up macro amateurs.Clojure macros are more straightforward to use than metaprogramming features in many other languages, but they're different enough from normal programming to present challenges of their own. "Mastering Clojure Macros" examines some of these issues, along with alternatives to macros where they exist.By the time you finish this book, you'll be thinking like a macro professional.What You Need: The book examples have been developed under Clojure 1.6.0, although earlier and later versions of Clojure may work as well. You'll want to use Leiningen 2.x in order to follow along with the examples that use external projects.

Audience
adult
Length
short · 100 pages

Click a tag to see books like this one that share it. Point at it (on a phone, tap it) for less of it instead.

Read it? Sign in to help tag it.

Liked Mastering Clojure Macros: Write Cleaner, Faster, Smarter Code? Here’s where I’d start.

These suit anyone who liked Mastering Clojure Macros: Write Cleaner, Faster, Smarter Code. Sign in and mark a few books for picks shaped around your own taste.

  1. Web Development with Clojure: Build Bulletproof Web Apps with Less Code Shares clojure, programming, tech
  2. Clojure Applied: From Practice to Practitioner Shares clojure, programming, lisp
  3. ClojureScript: Up and Running Shares clojure, programming, tech
  4. Clojure Data Analysis Cookbook Shares clojure, programming, lisp

“If you want more of the same (science about technology), start with these.”

  1. Debugging: The 9 Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems
  2. CoffeeScript
  3. The Art of Readable Code
  4. HTML5 Cookbook

“If it was the clojure that hooked you, try one of these.”

  1. Living Clojure
  2. Clojure Cookbook: Recipes for Functional Programming
  3. Practical Clojure
  4. Clojure In Action

“These start from a similar idea, even if they go somewhere else with it.”

  1. Metaprogramming Elixir
  2. Metaprogramming Ruby 2: Program Like the Ruby Pros
  3. The Joy of Clojure
  4. Microsoft Office Excel 2007: The L Line, The Express Line to Learning (The L Line: The Express Line To Learning)