summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boot.clj8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/boot.clj b/src/boot.clj
index 2570a060..74e0989c 100644
--- a/src/boot.clj
+++ b/src/boot.clj
@@ -667,6 +667,12 @@
([stream eof-error? eof-value recursive?]
(. clojure.lang.LispReader (read stream eof-error? eof-value recursive?))))
+(defmacro with-open [rdr init & body]
+ `(let [~rdr ~init]
+ (try-finally
+ (do ~@body)
+ (. ~rdr (close)))))
+
(defmacro doto [x & members]
(let [gx (gensym)]
`(let [~gx ~x]
@@ -824,7 +830,7 @@
make-proxy implement
prn print newline *out* *current-namespace* *print-meta*
doto memfn
- read *in*
+ read *in* with-open
time
int long float double short byte boolean char
aget aset aset-boolean aset-int aset-long aset-float aset-double aset-short aset-byte