Clojure, lazy appreciation

Consider the following code in clojure:

(let [a (find-a), b (find-b)] (println a) (println b))

Where b is the sequence. The find-a function also has some println statements. What I expect to see on standard outputs: a, results from println statements in find-a, b. However, I get: a, part b, the results from println statements in find-a, the rest of b.

Is this due to lazy sequence estimation?

+3
source share
1 answer

Nothing in this code is essentially lazy - everything should be done in the correct sequence.

, , a b, - , (println a) (println b). , a b - , map - , , println. , a b.

, , , - . Clojure - ,

+6

All Articles