deft/journal/2020-05-26--06-21-28Z--idiomatic_clojure_mixing_side_effects_and_iteration.org

13 lines
404 B
Org Mode
Raw Normal View History

2020-05-26 07:38:56 +00:00
#+TITLE: Idiomatic Clojure: Mixing Side Effects and Iteration
#+Author: Yann Esposito
tags :: [[file:2020-05-26--06-16-14Z--clojure.org][clojure]]
2020-05-26 07:45:32 +00:00
source :: [[https://bsless.github.io/side-effects/][Idiomatic Clojure: Mixing Side Effects and Iteration]]
2020-05-26 07:38:56 +00:00
Main lessons:
- Never use ~doall~
- use ~mapv~ or ~(into [] (map f) coll)~ if you want to retrieve the elements
- use ~(run! f coll)~ or ~doseq~