Skip to content

Commit 2a67068

Browse files
committed
fix: bind *file* in load-file
1 parent 275707e commit 2a67068

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/uclj/core.clj

+5-4
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,11 @@
561561
(defmethod seq->eval-node lf [&a _ [_ fname]]
562562
(let [arg (->eval-node &a nil fname)]
563563
(gen-eval-node
564-
(with-open [in (new java.io.PushbackReader (io/reader (io/file (evalme arg &b))))]
565-
(doseq [read (repeatedly #(read {:eof ::eof} in))
566-
:while (not= ::eof read)]
567-
(evaluator read)))))))
564+
(binding [*file* (io/file (evalme arg &b))]
565+
(with-open [in (new java.io.PushbackReader (io/reader *file*))]
566+
(doseq [read (repeatedly #(read {:eof ::eof} in))
567+
:while (not= ::eof read)]
568+
(evaluator read))))))))
568569

569570
;; Needed by (ns) forms.
570571
(defmethod seq->eval-node 'clojure.core/with-loading-context [&a _ [_ & bodies]]

0 commit comments

Comments
 (0)