Skip to content

A peer-to-peer stack for code collaboration

233 B
Raw Blame
{:module 'prelude/ref
 :doc "Functions for dealing with reference cells."
 :exports ['modify-ref]}

(def modify-ref
  "Modify `r` by applying the function `f`. Returns the new value."
  (fn [r f]
    (write-ref r (f (read-ref r)))))