sci.core
-
- function
([ns-publics-map sci-ns])
A
Adds class (JVM class or JS object) to `ctx` as `class-name` (a symbol). Returns mutated context.
function([ctx class-name class])
Adds import of class named by `class-name` (a symbol) to namespace named by `ns-name` (a symbol) under alias `alias` (a ...
function([ctx ns-name class-name alias])
Adds namespace map `ns-map` named by the symbol `ns-name` to `ctx`. Returns mutated context.
function([ctx ns-name ns-map])
Returns all SCI ns objects in the `ctx`
function([ctx])
Atomically alters the root binding of sci var v by applying f to its current value plus any args.
function([v f] [v f & args])
SCI var that represents SCI's clojure.core/*assert*
value
B
Macro for binding sci vars. Must be called with a vector of sci dynamic vars to values.
macro([bindings & body])
C
Returns map of names to SCI vars as a result of copying public Clojure vars from ns-sym (a symbol). Attaches sci-ns (r...
macro([ns-sym sci-ns] [ns-sym sci-ns opts])
Copies contents from var `sym` to a new sci var. The value `ns` is an object created with `sci.core/create-ns`. Opt...
macro([sym ns] [sym ns opts])
Copies Clojure var to SCI var. Runtime analog of compile time `copy-var`.
function([clojure-var sci-ns])
Creates namespace object. Can be used in var metadata.
function([sym] [sym meta])
E
Calling this will enable - Altering core vars using `alter-var-root` - In CLJS: `set!` is able to set the value of a...
function([])
SCI var that represents SCI's `clojure.core/*err*`
valueEvaluates form (as produced by `parse-string` or `parse-next`) in the context of `ctx` (as produced with `init`). To a...
function([ctx form])
Evaluates string `s` as one or multiple Clojure expressions using the Small Clojure Interpreter. The map `opts` may c...
function([s] [s opts])
Evaluates string `s` in the context of `ctx` (as produced with `init`).
function([ctx s])
Evaluates string `s` in the context of `ctx` (as produced with `init`). Options: *`:ns` - the namespace to start ...
function([ctx s] [ctx s opts])
F
SCI var that represents SCI's `clojure.core/*file*`
valueReturns SCI ns object as created with `sci/create-ns` from `ctx` found by `ns-sym`.
function([ctx ns-sym])
Forks a context (as produced with `init`) into a new context. Any new vars created in the new context won't be visible...
function([ctx])
Returns a list of formatted stack trace elements as strings from stacktrace.
function([stacktrace])
Like clojure.core/future but also conveys sci bindings to the thread.
macro([& body])
G
- function
([reader])
- function
([reader])
I
SCI var that represents SCI's `clojure.core/*in*`
valueCreates an initial sci context from given options `opts`. The context can be used with `eval-string*`. See `eval-strin...
function([opts])
Finds or creates a sci var named by the symbol name in the namespace ns (which can be a symbol or a sci namespace), se...
function([ctx sci-ns name] [ctx sci-ns name val])
M
Updates a context with opts merged in and returns it.
function([ctx opts])
N
Same as new-var but adds :dynamic true to meta.
function([name] [name init-val] [name init-val meta])
Same as new-var but adds :macro true to meta as well as :sci/macro true to meta of the fn itself.
function([name init-val] [name init-val meta])
Returns a new sci var.
function([name] [name init-val] [name init-val meta])
- function
([m])
SCI var that represents SCI's `clojure.core/*ns*`
valueReturns name of SCI ns as symbol.
function([sci-ns])
O
SCI var that represents SCI's `clojure.core/*out*`
value
P
Parses next form from reader
function([ctx reader] [ctx reader opts])
Parses next form from reader
function([ctx reader] [ctx reader opts])
Parses string `s` in the context of `ctx` (as produced with `init`).
function([ctx s])
Like clojure.core/pmap but also conveys sci bindings to the threads.
function([f coll] [f coll & colls])
SCI var that represents SCI's `clojure.core/*print-dup*`
valueSCI var that represents SCI's `clojure.core/*print-length*`
valueSCI var that represents SCI's `clojure.core/*print-level*`
valueSCI var that represents SCI's `clojure.core/*print-meta*`
valueSCI var that represents SCI's `clojure.core/*print-namespace-maps*`
valueSCI var that represents SCI's `clojure.core/*print-readably*`
value
R
S
Establish thread local binding of dynamic var
function([dynamic-var v])
- function
([x])
Returns list of stacktrace element maps from exception, if available.
function([ex])
V
Returns a fully qualified symbol from a `sci.lang.Var`
function([sci-var])
W
Macro for binding sci vars. Must be called with map of sci dynamic vars to values. Used in babashka.
macro([bindings-map & body])
Evaluates body in a context in which sci's *in* is bound to a fresh StringReader initialized with the string s.
macro([s & body])
Evaluates exprs in a context in which sci's *out* is bound to a fresh StringWriter. Returns the string created by any...
macro([& body])