diff --git a/API.md b/API.md index 96f2f168..e6c90748 100644 --- a/API.md +++ b/API.md @@ -104,7 +104,7 @@ needing something from the dark `impl` side! Function. Establish thread local binding of dynamic var -

Source

+

Source

----- # sci.async @@ -122,7 +122,7 @@ Establish thread local binding of dynamic var Mark promise to be flatteded into top level async evaluation, similar to top level await. -

Source

+

Source

## `await?` ``` clojure @@ -131,7 +131,7 @@ Mark promise to be flatteded into top level async evaluation, similar ``` Check if promise was marked with [`await`](#sci.async/await). -

Source

+

Source

## `eval-form` ``` clojure @@ -140,23 +140,24 @@ Check if promise was marked with [`await`](#sci.async/await). ``` Eval single form in ctx. -

Source

+

Source

## `eval-form+` ``` clojure -(eval-form+ ctx form) +(eval-form+ ctx s) +(eval-form+ ctx form opts) ``` Eval single form in ctx, return map of `:val` and `:ns`. -

Source

+

Source

## `eval-string*` ``` clojure (eval-string* ctx s) ``` -

Source

+

Source

## `eval-string+` ``` clojure @@ -168,7 +169,7 @@ Eval single form in ctx, return map of `:val` and `:ns`. Same as eval-string* but returns map with `:val`, the evaluation result, and `:ns`, the last active namespace. The return value can be passed back into `opts` to preserve the namespace state. -

Source

+

Source

## `require` @@ -177,7 +178,7 @@ Same as eval-string* but returns map with `:val`, the evaluation Async require that can be substituted for sync require by `{:namespaces {'clojure.core {'require scia/require}}}` -

Source

+

Source

----- # sci.core @@ -192,25 +193,25 @@ The main SCI API namespace. -

Source

+

Source

## `*2` -

Source

+

Source

## `*3` -

Source

+

Source

## `*e` -

Source

+

Source

## `add-class!` ``` clojure @@ -220,7 +221,7 @@ The main SCI API namespace. Adds class (JVM class or JS object) to `ctx` as `class-name` (a symbol). Returns mutated context. -

Source

+

Source

## `add-import!` ``` clojure @@ -229,7 +230,7 @@ Adds class (JVM class or JS object) to `ctx` as `class-name` (a ``` Adds import of class named by `class-name` (a symbol) to namespace named by [`ns-name`](#sci.core/ns-name) (a symbol) under alias `alias` (a symbol). Returns mutated context. -

Source

+

Source

## `add-js-lib!` ``` clojure @@ -238,7 +239,7 @@ Adds import of class named by `class-name` (a symbol) to namespace named by [`ns ``` Add js library to context, so it can be used with `require`. -

Source

+

Source

## `add-namespace!` ``` clojure @@ -248,7 +249,7 @@ Add js library to context, so it can be used with `require`. Adds namespace map `ns-map` named by the symbol [`ns-name`](#sci.core/ns-name) to `ctx`. Returns mutated context. -

Source

+

Source

## `all-ns` ``` clojure @@ -257,7 +258,7 @@ Adds namespace map `ns-map` named by the symbol [`ns-name`](#sci.core/ns-name) t ``` Returns all SCI ns objects in the `ctx` -

Source

+

Source

## `alter-var-root` ``` clojure @@ -268,7 +269,7 @@ Returns all SCI ns objects in the `ctx` Atomically alters the root binding of sci var v by applying f to its current value plus any args. -

Source

+

Source

## `assert` @@ -276,7 +277,7 @@ Atomically alters the root binding of sci var v by applying f to its SCI var that represents SCI's clojure.core/*assert* -

Source

+

Source

## `binding` ``` clojure @@ -287,7 +288,7 @@ Function. Macro for binding sci vars. Must be called with a vector of sci dynamic vars to values. -

Source

+

Source

## `copy-ns` ``` clojure @@ -318,7 +319,7 @@ Returns map of names to SCI vars as a result of copying public important for ClojureScript to not pull in vars into the compiled JS. Any additional vars can be added after the fact with sci/copy-var manually. -

Source

+

Source

## `copy-var` ``` clojure @@ -329,9 +330,12 @@ Returns map of names to SCI vars as a result of copying public Function. Copies contents from var `sym` to a new sci var. The value [`ns`](#sci.core/ns) is an - object created with [`sci.core/create-ns`](#sci.core/create-ns). If new-name is supplied, the - copied var will be named new-name. -

Source

+ object created with [`sci.core/create-ns`](#sci.core/create-ns). + + Options: + + - :name: The name of the copied var. Defaults to the original var name. +

Source

## `copy-var*` ``` clojure @@ -340,7 +344,7 @@ Copies contents from var `sym` to a new sci var. The value [`ns`](#sci.core/ns) ``` Copies Clojure var to SCI var. Runtime analog of compile time [`copy-var`](#sci.core/copy-var). -

Source

+

Source

## `create-ns` ``` clojure @@ -350,7 +354,7 @@ Copies Clojure var to SCI var. Runtime analog of compile time [`copy-var`](#sci. ``` Creates namespace object. Can be used in var metadata. -

Source

+

Source

## `enable-unrestricted-access!` ``` clojure @@ -364,7 +368,7 @@ Calling this will enable - In CLJS: instance method calls are not restricted to only `:classes` In the future, more unrestricted access may be added, so only use this when you're not using SCI as a sandbox. -

Source

+

Source

## `err` @@ -372,7 +376,7 @@ Calling this will enable SCI var that represents SCI's `clojure.core/*err*` -

Source

+

Source

## `eval-form` ``` clojure @@ -384,7 +388,7 @@ Evaluates form (as produced by [`parse-string`](#sci.core/parse-string) or [`par context of `ctx` (as produced with [`init`](#sci.core/init)). To allow namespace switches, establish root binding of `sci/ns` with `sci/binding` or `sci/with-bindings.` -

Source

+

Source

## `eval-string` ``` clojure @@ -413,7 +417,7 @@ Evaluates string `s` as one or multiple Clojure expressions using the Small Cloj - `:features`: when provided a non-empty set of keywords, sci will process reader conditionals using these features (e.g. #{:bb}). - `:ns-aliases`: a map of aliases to namespaces that are globally valid, e.g. `{'clojure.test 'cljs.test}` -

Source

+

Source

## `eval-string*` ``` clojure @@ -423,7 +427,7 @@ Evaluates string `s` as one or multiple Clojure expressions using the Small Cloj Evaluates string `s` in the context of `ctx` (as produced with [`init`](#sci.core/init)). -

Source

+

Source

## `eval-string+` ``` clojure @@ -441,7 +445,7 @@ Evaluates string `s` in the context of `ctx` (as produced with Returns map with: * `:val` - the evaluated value * `:ns` - the namespace object -

Source

+

Source

## `file` @@ -449,7 +453,7 @@ Evaluates string `s` in the context of `ctx` (as produced with SCI var that represents SCI's `clojure.core/*file*` -

Source

+

Source

## `find-ns` ``` clojure @@ -458,7 +462,7 @@ SCI var that represents SCI's `clojure.core/*file*` ``` Returns SCI ns object as created with `sci/create-ns` from `ctx` found by `ns-sym`. -

Source

+

Source

## `fork` ``` clojure @@ -469,7 +473,7 @@ Returns SCI ns object as created with `sci/create-ns` from `ctx` found by `ns-sy Forks a context (as produced with [`init`](#sci.core/init)) into a new context. Any new vars created in the new context won't be visible in the original context. -

Source

+

Source

## `format-stacktrace` ``` clojure @@ -478,7 +482,7 @@ Forks a context (as produced with [`init`](#sci.core/init)) into a new context. ``` Returns a list of formatted stack trace elements as strings from stacktrace. -

Source

+

Source

## `future` ``` clojure @@ -488,21 +492,21 @@ Returns a list of formatted stack trace elements as strings from stacktrace. Function. Like clojure.core/future but also conveys sci bindings to the thread. -

Source

+

Source

## `get-column-number` ``` clojure (get-column-number reader) ``` -

Source

+

Source

## `get-line-number` ``` clojure (get-line-number reader) ``` -

Source

+

Source

## `in` @@ -510,7 +514,7 @@ Like clojure.core/future but also conveys sci bindings to the thread. SCI var that represents SCI's `clojure.core/*in*` -

Source

+

Source

## `init` ``` clojure @@ -522,7 +526,7 @@ Creates an initial sci context from given options `opts`. The context can be used with [`eval-string*`](#sci.core/eval-string*). See [`eval-string`](#sci.core/eval-string) for available options. The internal organization of the context is implementation detail and may change in the future. -

Source

+

Source

## `intern` ``` clojure @@ -536,7 +540,7 @@ Finds or creates a sci var named by the symbol name in the namespace binding to val if supplied. The namespace must exist in the ctx. The sci var will adopt any metadata from the name symbol. Returns the sci var. -

Source

+

Source

## `merge-opts` ``` clojure @@ -545,7 +549,7 @@ Finds or creates a sci var named by the symbol name in the namespace ``` Updates a context with opts merged in and returns it. -

Source

+

Source

## `new-dynamic-var` ``` clojure @@ -556,7 +560,7 @@ Updates a context with opts merged in and returns it. ``` Same as new-var but adds :dynamic true to meta. -

Source

+

Source

## `new-macro-var` ``` clojure @@ -567,7 +571,7 @@ Same as new-var but adds :dynamic true to meta. Same as new-var but adds :macro true to meta as well as :sci/macro true to meta of the fn itself. -

Source

+

Source

## `new-var` ``` clojure @@ -578,14 +582,14 @@ Same as new-var but adds :macro true to meta as well ``` Returns a new sci var. -

Source

+

Source

## `normalize-meta` ``` clojure (normalize-meta m) ``` -

Source

+

Source

## `ns` @@ -593,7 +597,7 @@ Returns a new sci var. SCI var that represents SCI's `clojure.core/*ns*` -

Source

+

Source

## `ns-name` ``` clojure @@ -602,7 +606,7 @@ SCI var that represents SCI's `clojure.core/*ns*` ``` Returns name of SCI ns as symbol. -

Source

+

Source

## `out` @@ -610,7 +614,7 @@ Returns name of SCI ns as symbol. SCI var that represents SCI's `clojure.core/*out*` -

Source

+

Source

## `parse-next` ``` clojure @@ -620,7 +624,7 @@ SCI var that represents SCI's `clojure.core/*out*` ``` Parses next form from reader -

Source

+

Source

## `parse-next+string` ``` clojure @@ -630,7 +634,7 @@ Parses next form from reader ``` Parses next form from reader -

Source

+

Source

## `parse-string` ``` clojure @@ -640,7 +644,7 @@ Parses next form from reader Parses string `s` in the context of `ctx` (as produced with [`init`](#sci.core/init)). -

Source

+

Source

## `pmap` ``` clojure @@ -650,7 +654,7 @@ Parses string `s` in the context of `ctx` (as produced with ``` Like clojure.core/pmap but also conveys sci bindings to the threads. -

Source

+

Source

## `print-dup` @@ -658,7 +662,7 @@ Like clojure.core/pmap but also conveys sci bindings to the threads. SCI var that represents SCI's `clojure.core/*print-dup*` -

Source

+

Source

## `print-err-fn` @@ -666,7 +670,7 @@ SCI var that represents SCI's `clojure.core/*print-dup*` SCI var that represents SCI's `cljs.core/*print-err-fn*` -

Source

+

Source

## `print-fn` @@ -674,7 +678,7 @@ SCI var that represents SCI's `cljs.core/*print-err-fn*` SCI var that represents SCI's `cljs.core/*print-fn*` -

Source

+

Source

## `print-length` @@ -682,7 +686,7 @@ SCI var that represents SCI's `cljs.core/*print-fn*` SCI var that represents SCI's `clojure.core/*print-length*` -

Source

+

Source

## `print-level` @@ -690,7 +694,7 @@ SCI var that represents SCI's `clojure.core/*print-length*` SCI var that represents SCI's `clojure.core/*print-level*` -

Source

+

Source

## `print-meta` @@ -698,7 +702,7 @@ SCI var that represents SCI's `clojure.core/*print-level*` SCI var that represents SCI's `clojure.core/*print-meta*` -

Source

+

Source

## `print-namespace-maps` @@ -706,7 +710,7 @@ SCI var that represents SCI's `clojure.core/*print-meta*` SCI var that represents SCI's `clojure.core/*print-namespace-maps*` -

Source

+

Source

## `print-newline` @@ -714,7 +718,7 @@ SCI var that represents SCI's `clojure.core/*print-namespace-maps*` SCI var that represents SCI's `cljs.core/*print-newline*` -

Source

+

Source

## `print-readably` @@ -722,7 +726,7 @@ SCI var that represents SCI's `cljs.core/*print-newline*` SCI var that represents SCI's `clojure.core/*print-readably*` -

Source

+

Source

## `read-eval` @@ -730,7 +734,7 @@ SCI var that represents SCI's `clojure.core/*print-readably*` SCI var that represents SCI's `clojure.core/*read-eval*` -

Source

+

Source

## `reader` ``` clojure @@ -740,21 +744,21 @@ SCI var that represents SCI's `clojure.core/*read-eval*` Coerces x into indexing pushback-reader to be used with parse-next. Accepts: string or java.io.Reader. -

Source

+

Source

## `resolve` ``` clojure (resolve ctx sym) ``` -

Source

+

Source

## `source-reader` ``` clojure (source-reader x) ``` -

Source

+

Source

## `stacktrace` ``` clojure @@ -763,7 +767,7 @@ Coerces x into indexing pushback-reader to be used with ``` Returns list of stacktrace element maps from exception, if available. -

Source

+

Source

## `var->symbol` ``` clojure @@ -772,7 +776,7 @@ Returns list of stacktrace element maps from exception, if available. ``` Returns a fully qualified symbol from a `sci.lang.Var` -

Source

+

Source

## `with-bindings` ``` clojure @@ -783,7 +787,7 @@ Function. Macro for binding sci vars. Must be called with map of sci dynamic vars to values. Used in babashka. -

Source

+

Source

## `with-in-str` ``` clojure @@ -794,7 +798,7 @@ Function. Evaluates body in a context in which sci's *in* is bound to a fresh StringReader initialized with the string s. -

Source

+

Source

## `with-out-str` ``` clojure @@ -806,7 +810,7 @@ Function. 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. -

Source

+

Source

----- # sci.ctx-store @@ -874,7 +878,7 @@ Bind `ctx` during execution of body. Representation of a SCI namespace, created e.g. with `(create-ns 'foo)`. The fields of this type are implementation detail and should not be accessed directly. -

Source

+

Source

## `Type` @@ -892,7 +896,7 @@ Representation of a SCI custom type, created e.g. with `(defrecord Foo [])`. The Representation of a SCI var, created e.g. with `(defn foo [])` The fields of this type are implementation detail and should not be accessed directly. -

Source

+

Source

## `notify-watches` ``` clojure diff --git a/src/sci/core.cljc b/src/sci/core.cljc index 5e26ebcd..eaaadf67 100644 --- a/src/sci/core.cljc +++ b/src/sci/core.cljc @@ -60,8 +60,11 @@ (defmacro copy-var "Copies contents from var `sym` to a new sci var. The value `ns` is an - object created with `sci.core/create-ns`. If new-name is supplied, the - copied var will be named new-name." + object created with `sci.core/create-ns`. + + Options: + + - :name: The name of the copied var. Defaults to the original var name." ([sym ns] `(copy-var ~sym ~ns nil)) ([sym ns opts]