An S-Expression evaluation library
for Clojure and ClojureScript. Unlike Clojure's eval
, Quiddity lets you work
with limited forms using user-specified environment.
Leiningen dependency: [quiddity "0.3.0"]
Supported versions: Clojure 1.7 or higher, ClojureScript 1.9 or higher
You can invoke Quiddity evaluation with quiddity.core/evaluate
:
Syntax:
(evaluate form env err-h)
form
is a valid Clojure formenv
is user-specified environment -- a collection of maps for value lookuperr-h
is error handler (function that accepts error message and deals with it)Clojure example:
(evaluate (read-string "(inc (dec (+ n 10)))") [{:+ + :inc inc :dec dec :n 20}]
#(throw (RuntimeException. %)))
ClojureScript example:
(evaluate (cljs.reader/read-string "(inc (dec (+ n 10)))") [{:+ + :inc inc :dec dec :n 20}]
#(throw (js/Error %)))
lein do clean, test # test against lowest supported Clojure version
lein do clean, clj-test # test against all supported Clojure versions
lein do clean, cljs-test # test against all supported ClojureScript versions
Copyright © 2012-2020 Shantanu Kumar
Distributed under the Eclipse Public License, the same as Clojure.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close