Liking cljdoc? Tell your friends :D

sci.core


alter-var-rootclj/s

(alter-var-root v f & args)

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

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

bindingclj/smacro

(binding bindings & body)

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

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

copy-varclj/smacro

(copy-var sym ns)

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

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

create-nsclj/s

(create-ns sym)
(create-ns sym meta)

Creates namespace object. Can be used in var metadata.

Creates namespace object. Can be used in var metadata.
sourceraw docstring

errclj/s

Sci var that represents sci's clojure.core/*err*

Sci var that represents sci's `clojure.core/*err*`
sourceraw docstring

eval-stringclj/s

(eval-string s)
(eval-string s opts)

Evaluates string s as one or multiple Clojure expressions using the Small Clojure Interpreter.

The map opts may contain the following:

  • :bindings: a map of symbols to values, e.g.: {'x 1}. The symbols will acts as names bound to the corresponding values in the expressions.

  • :namespaces: a map of symbols to namespaces, where a namespace is a map with symbols to values, e.g.: {'foo.bar {'x 1}}. These namespaces can be used with require.

  • :allow: a seqable of allowed symbols. All symbols, even those brought in via :bindings or :namespaces have to be explicitly enumerated.

  • :deny: a seqable of disallowed symbols, e.g.: [loop quote recur].

  • :realize-max: integer; when provided, program may realize a maximum number of elements from sequences, e.g. (vec (range)) will throw for any number. This also applies to sequences returned from the expression to the caller.

  • :preset: a pretermined set of options. Currently only :termination-safe is supported, which will set :realize-max to 100 and disallows the symbols loop, recur and trampoline.

  • :features: when provided a non-empty set of keywords, sci will process reader conditionals using these features (e.g. #{:bb}).

  • :env: an atom with a map in which state from the evaluation (defined namespaced and vars) will be persisted for re-use over multiple calls.

Evaluates string `s` as one or multiple Clojure expressions using the Small Clojure Interpreter.

The map `opts` may contain the following:

- `:bindings`: a map of symbols to values, e.g.: `{'x 1}`. The
symbols will acts as names bound to the corresponding values in the
expressions.

- `:namespaces`: a map of symbols to namespaces, where a namespace
is a map with symbols to values, e.g.: `{'foo.bar {'x 1}}`. These
namespaces can be used with `require`.

- `:allow`: a seqable of allowed symbols. All symbols, even those
brought in via `:bindings` or `:namespaces` have to be explicitly
enumerated.

- `:deny`: a seqable of disallowed symbols, e.g.: `[loop quote
recur]`.

- `:realize-max`: integer; when provided, program may realize a
maximum number of elements from sequences, e.g. `(vec (range))` will
throw for any number. This also applies to sequences returned from
the expression to the caller.

- `:preset`: a pretermined set of options. Currently only
`:termination-safe` is supported, which will set `:realize-max` to
`100` and disallows the symbols `loop`, `recur` and `trampoline`.

- `:features`: when provided a non-empty set of keywords, sci will process reader conditionals using these features (e.g. #{:bb}).

- `:env`: an atom with a map in which state from the
evaluation (defined namespaced and vars) will be persisted for
re-use over multiple calls.
sourceraw docstring

eval-string*clj/s

(eval-string* ctx s)

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

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

fileclj/s

Sci var that represents sci's clojure.core/*file*

Sci var that represents sci's `clojure.core/*file*`
sourceraw docstring

futureclj/smacro

(future & body)

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

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

inclj/s

Sci var that represents sci's clojure.core/*in*

Sci var that represents sci's `clojure.core/*in*`
sourceraw docstring

initclj/s

(init opts)

Creates an initial sci context from given options opts. The context can be used with eval-string*. See eval-string for available options. The internal organization of the context is implementation detail and may change in the future.

Creates an initial sci context from given options `opts`. The context
can be used with `eval-string*`. See `eval-string` for available
options. The internal organization of the context is implementation
detail and may change in the future.
sourceraw docstring

new-dynamic-varclj/s

(new-dynamic-var name)
(new-dynamic-var name init-val)
(new-dynamic-var name init-val meta)

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

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

new-macro-varclj/s

(new-macro-var name init-val)
(new-macro-var 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.

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

new-varclj/s

(new-var name)
(new-var name init-val)
(new-var name init-val meta)

Returns a new sci var.

Returns a new sci var.
sourceraw docstring

nsclj/s

Sci var that represents sci's clojure.core/*ns*

Sci var that represents sci's `clojure.core/*ns*`
sourceraw docstring

outclj/s

Sci var that represents sci's clojure.core/*out*

Sci var that represents sci's `clojure.core/*out*`
sourceraw docstring

pmapclj

(pmap f coll)
(pmap f coll & colls)

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

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

Sci var that represents sci's clojure.core/*print-length*

Sci var that represents sci's `clojure.core/*print-length*`
sourceraw docstring

with-bindingsclj/smacro

(with-bindings bindings-map & body)

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

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

with-in-strclj/smacro

(with-in-str s & body)

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

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

with-out-strclj/smacro

(with-out-str & body)

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

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

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close