fix mutable cells (not sure what problem was
This commit is contained in:
parent
784378af34
commit
f3080d8e09
1 changed files with 1 additions and 3 deletions
|
|
@ -315,12 +315,10 @@
|
||||||
|
|
||||||
;; cell implementation idea taken from prismatic schema library
|
;; cell implementation idea taken from prismatic schema library
|
||||||
(defprotocol PMutableCell
|
(defprotocol PMutableCell
|
||||||
(get_cell [cell])
|
|
||||||
(set_cell [cell x]))
|
(set_cell [cell x]))
|
||||||
|
|
||||||
(deftype MutableCell [^:volatile-mutable q]
|
(deftype MutableCell [^:volatile-mutable q]
|
||||||
PMutableCell
|
PMutableCell
|
||||||
(get_cell [this] q)
|
|
||||||
(set_cell [this x] (set! q x)))
|
(set_cell [this x] (set! q x)))
|
||||||
|
|
||||||
(defn mutable-cell
|
(defn mutable-cell
|
||||||
|
|
@ -331,7 +329,7 @@
|
||||||
(set_cell cell val))
|
(set_cell cell val))
|
||||||
|
|
||||||
(defn get-cell [cell]
|
(defn get-cell [cell]
|
||||||
(get_cell cell))
|
(field cell 'q))
|
||||||
|
|
||||||
(defn update-cell! [cell afn]
|
(defn update-cell! [cell afn]
|
||||||
(let [ret (afn (get-cell cell))]
|
(let [ret (afn (get-cell cell))]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue