JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

eval

core-api


    function
    boot.janet on line 2705, column 1

    (eval form &opt env)

    Evaluates a form in the current environment. If more control over 
    the environment is needed, use `run-context`. Optionally pass in an 
    `env` table with available bindings.


1 exampleSign in to add an example
Loading...
# Contrived example returning the variadic arguments passed in.
(defmacro example-macro [& args] ~(tuple ,;args))

(example-macro 1 2 3) # => (1 2 3)
(def args [1 2 3])

# `apply` is for functions, but there's always `eval`.
(assert (= (example-macro 1 2 3)
           (eval ~(example-macro ,;args))))
4kbytePlayground