Cover by Brian Carper, Christophe Grand, Chas Emerick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Chapter 10. REPL-Oriented Programming

The quality of your tools is incredibly important, and can make or break the experience with a language, not to mention your degree of success more broadly. Clojure’s REPL, which we picked apart in Chapter 1, is its most foundational tool—and, as we’ll see, perhaps its most powerful as well.

As we’ve stressed from the beginning, Clojure is always compiled and has no interpreter. Further, as we learned in Chapter 5, Clojure’s compiler is fully available at runtime, making the entirety of the language available at runtime—and therefore available in the Clojure REPL. This means that:

  • Code you load and run in the REPL (say, in your development environment) will work and perform exactly the same as code loaded from files on disk (as they might be in a production environment).

  • You can use a REPL to define and redefine any Clojure construct at any time.

The ramifications of these characteristics make the REPL an absolutely indispensable part of every Clojure programmer’s toolchain in ways that are generally not true for REPLs and interpreters offered by other languages. Here, we’ll explore some of the workflows enabled by the REPL that might just change how you approach developing software.

Interactive Development

Interactive development is a loaded term that has been taken to mean all manner of things, as most modern languages offer some degree of interactivity. Even Java developers can interactively evaluate expressions, for example, when an application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required