brave-clojure-web icon indicating copy to clipboard operation
brave-clojure-web copied to clipboard

Error in Code in Chapter 3

Open hkopp opened this issue 4 years ago • 1 comments

When loop is explained, there is the following code:

(defn recursive-printer ([] (recursive-printer 0)) ([iteration] (println iteration) (if (> iteration 3) (println "Goodbye!") (recursive-printer (inc iteration))))) (recursive-printer) ; => Iteration 0 ; => Iteration 1 ; => Iteration 2 ; => Iteration 3 ; => Iteration 4 ; => Goodbye!

This code is wrong, as the word "Iteration" is not printed. Just the numbers.

hkopp avatar Feb 26 '20 20:02 hkopp

Sorry for the shitty formatting.

hkopp avatar Feb 26 '20 20:02 hkopp