aboutsummaryrefslogtreecommitdiffstats
path: root/examples/atom-concept.milch
blob: 4158b452cd30728870465bad8cee66c0a3ed6680 (plain)
1
2
3
4
5
6
7
8
9
10
11
(let state (atom! 10))

(let do-loop! (\![i n]
    (match true
        (lt? i n) (do (update! dec state)
                      (do-loop! (inc i) n))
        otherwise unit)))

(do-loop! 0 5)
(get! state)
; => 5