Play with base ref forms
This commit is contained in:
parent
9e25f24b3f
commit
fb89508bef
|
@ -370,16 +370,10 @@
|
||||||
|
|
||||||
(def source "
|
(def source "
|
||||||
|
|
||||||
fn swap! (r, f) -> {
|
ref foo = nil
|
||||||
let val = deref (r)
|
ref bar = nil
|
||||||
let new = f (val)
|
|
||||||
set! (r, new)
|
|
||||||
}
|
|
||||||
|
|
||||||
ref foo = 0
|
eq (foo, bar)
|
||||||
|
|
||||||
swap! (foo, inc)
|
|
||||||
swap! (foo, inc)
|
|
||||||
|
|
||||||
")
|
")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user