diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-01-25 20:30:13 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-01-25 20:30:13 +0000 |
commit | daab7f25995d9922f04a3b43d9a5e8d5fefcfa43 (patch) | |
tree | 2c359071966ce04ae3098f81d39c4289e4d4d7a6 /src/clj | |
parent | 6254b8d8262a4159c73abb435300c2bef3cbca34 (diff) |
Made Atream.Iter an IFn, so can act as generatorstreams
Diffstat (limited to 'src/clj')
-rw-r--r-- | src/clj/clojure/core.clj | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj index 6527f926..caa3669a 100644 --- a/src/clj/clojure/core.clj +++ b/src/clj/clojure/core.clj @@ -1299,7 +1299,7 @@ (. ref (touch)) (. ref (get))) -(def #^{:tag clojure.lang.Closer} *io-context* nil) +(def *io-context* nil) (defmacro sync "transaction-flags => TBD, pass nil for now @@ -1316,8 +1316,6 @@ (. clojure.lang.LockingTransaction (runInTransaction (fn [] ~@body))))) - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; fn stuff ;;;;;;;;;;;;;;;; @@ -1995,17 +1993,14 @@ "If an io! block occurs in a transaction, throws an IllegalStateException, else runs body in an implicit do. If the first expression in body is a literal string, will use that as the - exception message. Establishes a dynamic io context for use with io-scope." + exception message." [& body] (let [message (when (string? (first body)) (first body)) body (if message (rest body) body)] `(if (clojure.lang.LockingTransaction/isRunning) (throw (new IllegalStateException ~(or message "I/O in transaction"))) - (binding [*io-context* (clojure.lang.Closer.)] - (try - ~@body - (finally - (.close *io-context*))))))) + (binding [*io-context* true] + ~@body)))) (def *scope* nil) |