diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-01-20 23:48:34 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-01-20 23:48:34 +0000 |
commit | 06d3b59c23ef90c9410470652ed6fc408d360716 (patch) | |
tree | ebf9e5cf6ba2b73018cbb945e846872a8b60959a /src/clj | |
parent | 9c1ca8132937642298ad3c4b4cee6fa464a36633 (diff) |
added overloads for Atom.swap
fix RT.nth for Lists to use count only for RandomAccess
Diffstat (limited to 'src/clj')
-rw-r--r-- | src/clj/clojure/core.clj | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index d21c3f02..1b0d1484 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -1197,7 +1197,10 @@ (apply f current-value-of-atom args). Note that f may be called multiple times, and thus should be free of side effects. Returns the value that was swapped in." - [#^clojure.lang.Atom atom f & args] (.swap atom f args)) + ([#^clojure.lang.Atom atom f] (.swap atom f)) + ([#^clojure.lang.Atom atom f x] (.swap atom f x)) + ([#^clojure.lang.Atom atom f x y] (.swap atom f x y)) + ([#^clojure.lang.Atom atom f x y & args] (.swap atom f x y args))) (defn compare-and-set! "Atomically sets the value of atom to newval if and only if the |