sci: use public vars
This commit is contained in:
parent
62e4a53c90
commit
ff2381a17c
2 changed files with 5 additions and 6 deletions
2
sci
2
sci
|
|
@ -1 +1 @@
|
||||||
Subproject commit f758061585c8ccb47ad07af1a2bb351b1c79d803
|
Subproject commit 0d2fc641df8021a8a2db8b248abd33fd623d7458
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[sci.impl.interpreter :refer [eval-string*]]
|
[sci.impl.interpreter :refer [eval-string*]]
|
||||||
[sci.impl.opts :as sci-opts]
|
[sci.impl.opts :as sci-opts]
|
||||||
[sci.impl.types :as sci-types]
|
|
||||||
[sci.impl.unrestrict :refer [*unrestricted*]]
|
[sci.impl.unrestrict :refer [*unrestricted*]]
|
||||||
[sci.impl.vars :as vars])
|
[sci.impl.vars :as vars])
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
@ -227,8 +226,8 @@ Everything after that is bound to *command-line-args*."))
|
||||||
(defn load-file* [sci-ctx f]
|
(defn load-file* [sci-ctx f]
|
||||||
(let [f (io/file f)
|
(let [f (io/file f)
|
||||||
s (slurp f)]
|
s (slurp f)]
|
||||||
(sci/with-bindings {vars/current-ns @vars/current-ns
|
(sci/with-bindings {sci/ns @sci/ns
|
||||||
vars/current-file (.getCanonicalPath f)}
|
sci/file (.getCanonicalPath f)}
|
||||||
(eval-string* sci-ctx s))))
|
(eval-string* sci-ctx s))))
|
||||||
|
|
||||||
(defn start-socket-repl! [address ctx]
|
(defn start-socket-repl! [address ctx]
|
||||||
|
|
@ -320,7 +319,7 @@ Everything after that is bound to *command-line-args*."))
|
||||||
(prn "M" (meta (get bindings 'future))))
|
(prn "M" (meta (get bindings 'future))))
|
||||||
(binding [*unrestricted* true]
|
(binding [*unrestricted* true]
|
||||||
(sci/binding [reflection-var false
|
(sci/binding [reflection-var false
|
||||||
vars/current-ns (vars/->SciNamespace 'user nil)]
|
sci/ns (vars/->SciNamespace 'user nil)]
|
||||||
(let [t0 (System/currentTimeMillis)
|
(let [t0 (System/currentTimeMillis)
|
||||||
{:keys [:version :shell-in :edn-in :shell-out :edn-out
|
{:keys [:version :shell-in :edn-in :shell-out :edn-out
|
||||||
:help? :file :command-line-args
|
:help? :file :command-line-args
|
||||||
|
|
@ -354,7 +353,7 @@ Everything after that is bound to *command-line-args*."))
|
||||||
(let [res (cp/source-for-namespace loader namespace nil)]
|
(let [res (cp/source-for-namespace loader namespace nil)]
|
||||||
(when uberscript (swap! uberscript-sources conj (:source res)))
|
(when uberscript (swap! uberscript-sources conj (:source res)))
|
||||||
res)))
|
res)))
|
||||||
_ (when file (vars/bindRoot vars/current-file (.getCanonicalPath (io/file file))))
|
_ (when file (vars/bindRoot sci/file (.getCanonicalPath (io/file file))))
|
||||||
ctx {:aliases aliases
|
ctx {:aliases aliases
|
||||||
:namespaces (-> namespaces
|
:namespaces (-> namespaces
|
||||||
(assoc 'clojure.core
|
(assoc 'clojure.core
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue