eval-string
function
sci.core/eval-string
(eval-string [s] [s opts])Evaluates string `s` as one or multiple Clojure expressions using the Small Clojure Interpreter.
The map `opts` may contain the following:
- `: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 `:namespaces` have to be explicitly
enumerated.
- `:deny`: a seqable of disallowed symbols, e.g.: `[loop quote
recur]`.
- `: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}`
- `:bindings`: DEPRECATED - `:bindings x` is the same as `:namespaces {'user x}`.
Examples
No examples yet. Be the first to add one!