Fix #1592: expose sci.core in babashka (#1593)

This commit is contained in:
Michiel Borkent 2023-08-04 11:43:14 +02:00 committed by GitHub
parent 4c7bbeeb3b
commit 83c02cb58b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View file

@ -7,6 +7,10 @@ A preview of the next release can be installed from
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
## Unreleased
- [#1592](https://github.com/babashka/babashka/issues/1592): expose `sci.core` in babashka
## 1.3.182 (2023-07-20)
- [#1579](https://github.com/babashka/babashka/issues/1579): add `clojure.tools.reader/resolve-symbol`

View file

@ -0,0 +1,8 @@
(ns babashka.impl.sci
{:no-doc true}
(:require [sci.core :as sci]))
(def sns (sci/create-ns 'sci.core nil))
(def sci-core-namespace
(sci/copy-ns sci.core sns))

View file

@ -45,6 +45,7 @@
[babashka.impl.reify2 :refer [reify-fn]]
[babashka.impl.repl :as repl]
[babashka.impl.rewrite-clj :as rewrite]
[babashka.impl.sci :refer [sci-core-namespace]]
[babashka.impl.server :refer [clojure-core-server-namespace]]
[babashka.impl.socket-repl :as socket-repl]
[babashka.impl.tasks :as tasks :refer [tasks-namespace]]
@ -354,8 +355,6 @@ Use bb run --help to show this help output.
(defn catvec [& xs]
(into [] cat xs))
(def sci-ns (sci/create-ns 'sci.core))
(def main-var (sci/new-var 'main nil {:ns clojure-main-ns}))
(def namespaces
@ -418,13 +417,7 @@ Use bb run --help to show this help output.
{'catvec (sci/copy-var catvec
(sci/create-ns 'clojure.core.rrb-vector))})
'edamame.core edamame-namespace
'sci.core {'format-stacktrace (sci/copy-var sci/format-stacktrace sci-ns)
'stacktrace (sci/copy-var sci/stacktrace sci-ns)
;; 'eval-string (sci/copy-var sci/eval-string sci-ns)
;; 'eval-string* (sci/copy-var sci/eval-string* sci-ns)
;; 'init (sci/copy-var sci/init sci-ns)
;; 'fork (sci/copy-var sci/fork sci-ns)
}
'sci.core sci-core-namespace
'babashka.cli cli/cli-namespace
'babashka.http-client http-client-namespace}
features/xml? (assoc 'clojure.data.xml @(resolve 'babashka.impl.xml/xml-namespace)