4 ms·
> if/else, for/do/while The thing is, these are different in Clojure than in various other languages (although more in common with other Lisps). Constructs lik
by jcromartie 15y ago
> if/else, for/do/while
The thing is, these are different in Clojure than in various other languages (although more in common with other Lisps). Constructs like "if" are expressions which return values, which will confuse you the first time it comes up if you don't realize that everything is an expression.
Then there's "for/do/while", where "for" in Clojure is not a loop at all because it produces a lazy sequence. And the equivalent to "do/while" (loop/recur, which enforces tail recursion) is something of a last resort where other sequence functions have failed.
I agree with you 100% that the learning material is a little dry. I don't know what kind of material would work best...