Skip to main content

sci.core

*

-

A

  • add-class!

    Adds class (JVM class or JS object) to `ctx` as `class-name` (a symbol). Returns mutated context.

  • add-import!

    Adds import of class named by `class-name` (a symbol) to namespace named by `ns-name` (a symbol) under alias `alias` (a ...

  • add-namespace!

    Adds namespace map `ns-map` named by the symbol `ns-name` to `ctx`. Returns mutated context.

  • all-ns

    Returns all SCI ns objects in the `ctx`

  • alter-var-root

    Atomically alters the root binding of sci var v by applying f to its current value plus any args.

  • assert

    SCI var that represents SCI's clojure.core/*assert*

B

  • binding

    Macro for binding sci vars. Must be called with a vector of sci dynamic vars to values.

C

  • copy-ns

    Returns map of names to SCI vars as a result of copying public Clojure vars from ns-sym (a symbol). Attaches sci-ns (r...

  • copy-var

    Copies contents from var `sym` to a new sci var. The value `ns` is an object created with `sci.core/create-ns`. Opt...

  • copy-var*

    Copies Clojure var to SCI var. Runtime analog of compile time `copy-var`.

  • create-ns

    Creates namespace object. Can be used in var metadata.

E

  • enable-unrestricted-access!

    Calling this will enable - Altering core vars using `alter-var-root` - In CLJS: `set!` is able to set the value of a...

  • err

    SCI var that represents SCI's `clojure.core/*err*`

  • eval-form

    Evaluates form (as produced by `parse-string` or `parse-next`) in the context of `ctx` (as produced with `init`). To a...

  • eval-string

    Evaluates string `s` as one or multiple Clojure expressions using the Small Clojure Interpreter. The map `opts` may c...

  • eval-string*

    Evaluates string `s` in the context of `ctx` (as produced with `init`).

  • eval-string+

    Evaluates string `s` in the context of `ctx` (as produced with `init`). Options: *`:ns` - the namespace to start ...

F

  • file

    SCI var that represents SCI's `clojure.core/*file*`

  • find-ns

    Returns SCI ns object as created with `sci/create-ns` from `ctx` found by `ns-sym`.

  • fork

    Forks a context (as produced with `init`) into a new context. Any new vars created in the new context won't be visible...

  • format-stacktrace

    Returns a list of formatted stack trace elements as strings from stacktrace.

  • future

    Like clojure.core/future but also conveys sci bindings to the thread.

G

I

  • in

    SCI var that represents SCI's `clojure.core/*in*`

  • init

    Creates an initial sci context from given options `opts`. The context can be used with `eval-string*`. See `eval-strin...

  • intern

    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...

M

  • merge-opts

    Updates a context with opts merged in and returns it.

N

  • new-dynamic-var

    Same as new-var but adds :dynamic true to meta.

  • new-macro-var

    Same as new-var but adds :macro true to meta as well as :sci/macro true to meta of the fn itself.

  • new-var

    Returns a new sci var.

  • ns

    SCI var that represents SCI's `clojure.core/*ns*`

  • ns-name

    Returns name of SCI ns as symbol.

O

  • out

    SCI var that represents SCI's `clojure.core/*out*`

P

  • parse-next

    Parses next form from reader

  • parse-next+string

    Parses next form from reader

  • parse-string

    Parses string `s` in the context of `ctx` (as produced with `init`).

  • pmap

    Like clojure.core/pmap but also conveys sci bindings to the threads.

  • print-dup

    SCI var that represents SCI's `clojure.core/*print-dup*`

  • print-length

    SCI var that represents SCI's `clojure.core/*print-length*`

  • print-level

    SCI var that represents SCI's `clojure.core/*print-level*`

  • print-meta

    SCI var that represents SCI's `clojure.core/*print-meta*`

  • print-namespace-maps

    SCI var that represents SCI's `clojure.core/*print-namespace-maps*`

  • print-readably

    SCI var that represents SCI's `clojure.core/*print-readably*`

R

  • read-eval

    SCI var that represents SCI's `clojure.core/*read-eval*`

  • reader

    Coerces x into indexing pushback-reader to be used with parse-next. Accepts: string or java.io.Reader.

S

  • set!

    Establish thread local binding of dynamic var

  • stacktrace

    Returns list of stacktrace element maps from exception, if available.

V

  • var->symbol

    Returns a fully qualified symbol from a `sci.lang.Var`

W

  • with-bindings

    Macro for binding sci vars. Must be called with map of sci dynamic vars to values. Used in babashka.

  • with-in-str

    Evaluates body in a context in which sci's *in* is bound to a fresh StringReader initialized with the string s.

  • with-out-str

    Evaluates exprs in a context in which sci's *out* is bound to a fresh StringWriter. Returns the string created by any...