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~
|
|
|
|
|