タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

clojureとatomに関するnabinnoのブックマーク (2)

  • dialelo/atomo · GitHub

    Clojure's Atom implementation in JavaScript. From the Clojure docs: Atoms provide a way to manage shared, synchronous, independent state. On top of the above, atoms provide also validation and observation capabilities. Installation $ npm install atomo Usage Atoms are references to values that may change over time. The most basic operation on an atom is querying its current value:

  • Clojure ref, atom, agent の要約

    stm.md Clojure ref, atom, agent の要約 ref (協調的, 同期的) atom (非協調的, 同期的) agent (非同期的) ref (協調的, 同期的) 作成: ref 参照: deref または @ 変更: dosync で包んで ref-set: 上書き alter: 関数を適用して再代入(順序を保証) commute: 関数を適用して再代入(順序保証なし) 作成 (def x (ref '(1 2 3))) 参照 (deref x) ; -> (1 2 3) @x ; -> (1 2 3) 変更/上書き ref の変更は dosync で包むことで, 複数の変更のアトミシティが保証されるが, 単独の変更の場合でも, dosync で包む必要がある. (ref-set x '(2 3 4)) ; -> java.lang.IllegalStateE

    Clojure ref, atom, agent の要約
  • 1