diff --git a/hy/stepA_mal.hy b/hy/stepA_mal.hy index 67c9943417..0981895fd9 100755 --- a/hy/stepA_mal.hy +++ b/hy/stepA_mal.hy @@ -174,6 +174,7 @@ (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)))))))))") +(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)))))))") (defmain [&rest args] (if (>= (len args) 2)