August 2014
Intermediate to advanced
120 pages
2h 45m
English
In many languages, within your first 24 hours with the language, you learn the few looping constructs that you will ever use. Often, those constructs include while, do-while, and for. Clojure does come with a number of built-in control flow tools like while and for (though Clojure’s for is a list comprehension, much fancier than the for loop that imperative languages often use to iterate over indexed elements). More importantly, in Clojure’s case, these constructs are almost always macros. We could have written them ourselves and used them in our programs. I don’t know about you, but this gives me a tremendous feeling of power.
Let’s see how easy it can be to build these ourselves, starting with while:
| control_flow/while.clj ... |
Read now
Unlock full access