2 (:require [clojure.repl]
9 (let [line (if strng strng (read-line))]
10 (reader/read-string strng)))
14 (defn eval-ast [ast env]
16 (symbol? ast) (or (get env ast)
17 (throw (Error. (str ast " not found"))))
19 (seq? ast) (doall (map #(EVAL % env) ast))
21 (vector? ast) (vec (doall (map #(EVAL % env) ast)))
23 (map? ast) (apply hash-map (doall (map #(EVAL % env)
24 (mapcat identity ast))))
29 ;;(prn "EVAL" ast (keys @env)) (flush)
34 (let [el (eval-ast ast env)
40 (defn PRINT [exp] (pr-str exp))
49 (PRINT (EVAL (READ strng) repl-env)))
53 (let [line (readline/readline "user> ")]
55 (when-not (re-seq #"^\s*$|^\s*;.*$" line) ; blank/comment
59 (clojure.repl/pst e))))