clojurescript-unraveled icon indicating copy to clipboard operation
clojurescript-unraveled copied to clipboard

Better explanation of side effects

Open t-gebauer opened this issue 7 years ago • 0 comments

I disagree with this statement:

3.7.2. Blocks [...] A side effect is something that is not necessary for the return value.

  1. Some side effects might also affect the return value. The return value might change depending on some external state.
  2. A side effect should be observable from the outside of the function scope.
(do
  (println "something")    ; this is a side effect
  (- 1 2)                  ; this isn't
  (+ 3 4))

t-gebauer avatar Aug 16 '17 14:08 t-gebauer