This code works:
(def n1 (range))
(println
(->> n1
(take 30))
)
This code does not work:
(def n2 (iterate inc 0))
(println
(->> n2
(take 20))
)
A modified code (n2 is function) works:
(def n2 #(iterate inc 0))
(println
(->> (n2)
(take 20))
)
How come the second code is not allowed?
In the first code, (range) returns infinite sequence (0...)
in the second code, (iterate inc 0) also returns infinite sequence (0...)
What makes so different?
Please guide. Thanks.
(EDIT)
glad to hear the code#1 and code#1 is equivalent.
however, in my environment (light table) can't eval it: