diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/atom.milch (renamed from examples/atom-concept.milch) | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/atom-concept.milch b/examples/atom.milch index 4158b45..0ee6f8f 100644 --- a/examples/atom-concept.milch +++ b/examples/atom.milch @@ -1,11 +1,14 @@ +(import "core/common") + (let state (atom! 10)) (let do-loop! (\![i n] (match true - (lt? i n) (do (update! dec state) + (lt? i n) (do (atom-update! inc state) (do-loop! (inc i) n)) otherwise unit))) (do-loop! 0 5) -(get! state) -; => 5 + +(atom-get! state) +; => 15 |
