Chapter 2. Drinking from the Clojure firehose

 

This chapter provides a quick tour of the bare necessities—the things you’ll need to know to understand the rest of this book. If you’ve been programming with Clojure for a while, this may be a review, but otherwise it should give you everything you need to start writing Clojure code. In most cases throughout this chapter, the examples provided will be perfunctory in order to highlight the immediate point. Later in the book we’ll build on these topics and many more, so don’t worry if you don’t quite grasp every feature now—you’ll get there.

Interaction with Clojure is often performed at the Read-Eval-Print Loop (REPL). When starting a new REPL session, you’re presented with a simple prompt:

user>

2.1. Scalars

2.2. Putting things together: collections

2.3. Making things happen: functions

2.4. Vars

2.5. Locals, loops, and blocks

2.6. Preventing things from happening: quoting

2.7. Leveraging Java via interop

2.8. Exceptional circumstances

2.9. Namespaces

2.10. Summary

sitemap