[#234] *ns* should be controllable set per socket REPL connection
This commit is contained in:
parent
9269f1087f
commit
8f698894f6
3 changed files with 7 additions and 5 deletions
2
sci
2
sci
|
|
@ -1 +1 @@
|
|||
Subproject commit 641a1d943d8df4f7ffdf0f243dcda0ad54f7bad5
|
||||
Subproject commit 3f448903550feaeb7d752c958f6422a5fde667f7
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
[clojure.tools.reader.reader-types :as r]
|
||||
[sci.impl.interpreter :refer [eval-form]]
|
||||
[sci.impl.parser :as parser]
|
||||
[sci.impl.vars :as vars]
|
||||
[sci.core :as sci]
|
||||
[sci.impl.io :as sio]))
|
||||
|
||||
|
|
@ -58,7 +59,7 @@
|
|||
expr)]
|
||||
ret)))
|
||||
:need-prompt (or need-prompt (fn [] true))
|
||||
:prompt (or prompt #(sio/printf "%s=> " (-> sci-ctx :env deref :current-ns)))
|
||||
:prompt (or prompt #(sio/printf "%s=> " (vars/current-ns-name)))
|
||||
:flush (or flush sio/flush)
|
||||
:print (or print sio/prn)
|
||||
:caught (or caught repl-caught)))))
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@
|
|||
(vars/bindRoot sci/err *err*)
|
||||
|
||||
(defn repl! []
|
||||
(start-repl! (init {:bindings {'*command-line-args*
|
||||
["a" "b" "c"]}
|
||||
:env (atom {})})))
|
||||
(sci/with-bindings {vars/current-ns (vars/->SciNamespace 'user)}
|
||||
(start-repl! (init {:bindings {'*command-line-args*
|
||||
["a" "b" "c"]}
|
||||
:env (atom {})}))))
|
||||
|
||||
(defn assert-repl [expr expected]
|
||||
(is (str/includes? (sci/with-out-str
|
||||
|
|
|
|||
Loading…
Reference in a new issue