(code->results forms)
(code->results forms {:keys [timeout disable-timeout? disable-security?], :or {timeout 4000, disable-timeout? false, disable-security? false}, :as opts})
Returns a vector of the evaluated result of each of the given forms.
If any of the forms are strings, it will read them first.
Source
(defn code->results
"Returns a vector of the evaluated result of each of the given forms.
If any of the forms are strings, it will read them first."
([forms]
(code->results forms {}))
([forms {:keys [timeout
disable-timeout?
disable-security?]
:or {timeout 4000
disable-timeout? false
disable-security? false}
:as opts}]
(let [opts {:timeout timeout
:disable-timeout? disable-timeout?
:disable-security? disable-security?}]
(loop [forms forms
results []
nspace (create-ns 'clj.user)]
(if-let [form (first forms)]
(let [[result current-ns] (eval-form form nspace opts)]
(recur (rest forms) (conj results result) current-ns))
results)))))