Skip to content

Instantly share code, notes, and snippets.

@clarkenciel
Created August 11, 2018 20:04
Show Gist options
  • Save clarkenciel/4c630958d699987e3498065bc358d0bf to your computer and use it in GitHub Desktop.
Save clarkenciel/4c630958d699987e3498065bc358d0bf to your computer and use it in GitHub Desktop.
comparing how two maps behave on a lazy sequence vs a vector in clojure
clj.core> (let [s1 (->> '(1 2 3)
(map #(do (println (* 10 %)) %))
(map #(do (println %) %)))
]
s1)
10
1
20
2
30
3
(1 2 3)
clj.core> (let [s1 (->> [1 2 3]
(map #(do (println (* 10 %)) %))
(map #(do (println %) %)))
]
s1)
10
20
30
1
2
3
(1 2 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment