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:
|
So for example, let's say you write a program like this:
|
||||||
|
|
||||||
#+begin_src clojure
|
#+begin_src clojure
|
||||||
(let [x (first-action)
|
(defn my-action []
|
||||||
y (second-action)
|
(let [x (first-action)
|
||||||
z (third-action x y)]
|
y (second-action)
|
||||||
(if z
|
z (third-action x y)]
|
||||||
(fourth-action x)
|
(if z
|
||||||
(fifth-action y)))
|
(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
|
#+end_src
|
||||||
|
|
Loading…
Reference in a new issue