Public Vars

Back

ref-set (clj)

(source)

function

(ref-set ref val)
Must be called in a transaction. Sets the value of ref. Returns val.

Examples

clojure-goes-fast/lazy-require
  ;; First, ensure that it really takes awhile to load.
  (let [start (System/currentTimeMillis)]
    (require 'clojure.core.reducers)
    (is (> (- (System/currentTimeMillis) start) 50)
        "Loading c.c.reducers should take some time."))

  ;; Flush *loaded-libs* so that c.c.reducers is not "loaded" now
  (dosync (ref-set @#'clojure.core/*loaded-libs* (sorted-set)))