diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-16 23:57:50 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-16 23:57:50 -0500 |
| commit | 8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 (patch) | |
| tree | 13e5b2878f19ee24272ead8a92a9cb84b33ad0e5 /clojure/src/step5_tco.clj | |
| parent | a05f7822b10ed4cdd61ed8384299a003baf1c1c6 (diff) | |
| download | mal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.tar.gz mal-8cb5cda46cf3aef847ae3926dc53a5e5f87fe261.zip | |
All: move some fns to core. Major cleanup.
- Don't import/require core until step4.
- Define cond/or macros from step8
Diffstat (limited to 'clojure/src/step5_tco.clj')
| -rw-r--r-- | clojure/src/step5_tco.clj | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clojure/src/step5_tco.clj b/clojure/src/step5_tco.clj index f4f0107..69e09bf 100644 --- a/clojure/src/step5_tco.clj +++ b/clojure/src/step5_tco.clj @@ -83,12 +83,11 @@ [strng] (PRINT (EVAL (READ strng) repl-env))) -(defn _ref [k,v] (env/env-set repl-env k v)) +;; core.clj: defined using Clojure +(doseq [[k v] core/core_ns] (env/env-set repl-env k v)) +(env/env-set repl-env 'eval (fn [ast] (EVAL ast repl-env))) -;; Import types related functions -(doseq [[k v] core/core_ns] (_ref k v)) - -;; Defined using the language itself +;; core.mal: defined using the language itself (rep "(def! not (fn* [a] (if a false true)))") (defn -main [& args] |
