From e65457cf2998aac3d0a6299e402f58d30a1653e9 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 18 Nov 2020 20:38:05 +0100 Subject: [PATCH] Use REPL variables from sci --- sci | 2 +- src/babashka/impl/repl.clj | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/sci b/sci index af30be05..f1b35e0a 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit af30be059583c498b5deb65647131ae7b78f5669 +Subproject commit f1b35e0a0de4335fd0a6af2cea10bfa04919161e diff --git a/src/babashka/impl/repl.clj b/src/babashka/impl/repl.clj index ae0c8b4f..5ba96791 100644 --- a/src/babashka/impl/repl.clj +++ b/src/babashka/impl/repl.clj @@ -62,18 +62,12 @@ v)))) :eval (or eval (fn [expr] - (sci/with-bindings {sci/file ""} - (let [ret (eval-form (update sci-ctx - :env - (fn [env] - (swap! env update-in [:namespaces 'clojure.core] - assoc - '*1 *1 - '*2 *2 - '*3 *3 - '*e *e) - env)) - expr)] + (sci/with-bindings {sci/file "" + sci/*1 *1 + sci/*2 *2 + sci/*3 *3 + sci/*e *e} + (let [ret (eval-form sci-ctx expr)] ret)))) :need-prompt (or need-prompt (fn [] true)) :prompt (or prompt #(sio/printf "%s=> " (vars/current-ns-name)))