(defn seq-trial
[]
(map #(do (println "hello " %) (inc %)) (range 10)))
(take 3 (seq-trial))
The code snippt above when evaluated prints out the following -
(hello 0 hello 1 hello 2 hello 3 hello 4 hello 5 hello 6 hello 7 hello 8 hello 9 1 2 3)
Because map returns a lazy sequence I expected this to print only -
(hello 0 hello 1 hello 2 1 2 3)
Why is the entire list evaluated here?