X-Git-Url: https://git.hcoop.net/jackhill/mal.git/blobdiff_plain/dc191336f8896205ed114c7dfcb31dd97addf2ad..26ced15b31c6ebfd77c7297a7f8d346ff08c3f9b:/r/stepA_mal.r diff --git a/r/stepA_mal.r b/r/stepA_mal.r index edf41de4..2d610526 100644 --- a/r/stepA_mal.r +++ b/r/stepA_mal.r @@ -169,9 +169,6 @@ Env.set(repl_env, "*ARGV*", new.list()) . <- rep("(def! not (fn* (a) (if a false true)))") . <- rep("(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))") . <- rep("(defmacro! cond (fn* (& xs) (if (> (count xs) 0) (list 'if (first xs) (if (> (count xs) 1) (nth xs 1) (throw \"odd number of forms to cond\")) (cons 'cond (rest (rest xs)))))))") -. <- rep("(def! *gensym-counter* (atom 0))") -. <- rep("(def! gensym (fn* [] (symbol (str \"G__\" (swap! *gensym-counter* (fn* [x] (+ 1 x)))))))") -. <- rep("(defmacro! or (fn* (& xs) (if (empty? xs) nil (if (= 1 (count xs)) (first xs) (let* (condvar (gensym)) `(let* (~condvar ~(first xs)) (if ~condvar ~condvar (or ~@(rest xs)))))))))") args <- commandArgs(trailingOnly = TRUE)