journal/2020-12-23--16-50-17Z--effects_system_in_clojure.org
This commit is contained in:
parent
1bbd119228
commit
e16344b246
1 changed files with 17 additions and 6 deletions
|
@ -20,10 +20,21 @@ context the program is executed in.
|
|||
So for example, let's say you write a program like this:
|
||||
|
||||
#+begin_src clojure
|
||||
(let [x (first-action)
|
||||
y (second-action)
|
||||
z (third-action x y)]
|
||||
(if z
|
||||
(fourth-action x)
|
||||
(fifth-action y)))
|
||||
(defn my-action []
|
||||
(let [x (first-action)
|
||||
y (second-action)
|
||||
z (third-action x y)]
|
||||
(if z
|
||||
(fourth-action x)
|
||||
(fifth-action y))))
|
||||
#+end_src
|
||||
|
||||
Generally you expect every =*-action= to be a well defined function.
|
||||
You can take a look at that function and see what code will be execute.
|
||||
|
||||
Within an effect system, you would be able to write sommething like this:
|
||||
|
||||
#+begin_src clojure
|
||||
(with-effects [])
|
||||
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue