Home

Awesome

quiddity

cljdoc badge

An S-Expression evaluation library for Clojure and ClojureScript. Unlike Clojure's eval, Quiddity lets you work with limited forms using user-specified environment.

Usage

Leiningen dependency: [quiddity "0.3.0"]

Supported versions: Clojure 1.7 or higher, ClojureScript 1.9 or higher

Evaluation Quickstart

You can invoke Quiddity evaluation with quiddity.core/evaluate:

Syntax:

(evaluate form env err-h)

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 %)))

Documentation

See Introduction to Quiddity

Development

Running tests

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

License

Copyright © 2012-2020 Shantanu Kumar

Distributed under the Eclipse Public License, the same as Clojure.