Merge pull request #440 from aasimk2000/add-nil-if-test
[jackhill/mal.git] / crystal / step9_try.cr
index 5d63bc8..d56f149 100755 (executable)
@@ -246,9 +246,8 @@ REPL_ENV = Mal::Env.new nil
 Mal::NS.each { |k, v| REPL_ENV.set(k, Mal::Type.new(v)) }
 REPL_ENV.set("eval", Mal::Type.new ->(args : Array(Mal::Type)) { Mal.eval(args[0], REPL_ENV) })
 Mal.rep "(def! not (fn* (a) (if a false true)))"
-Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \")\")))))"
+Mal.rep "(def! load-file (fn* (f) (eval (read-string (str \"(do \" (slurp f) \"\nnil)\")))))"
 Mal.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)))))))"
-Mal.rep "(defmacro! or (fn* (& xs) (if (empty? xs) nil (if (= 1 (count xs)) (first xs) `(let* (or_FIXME ~(first xs)) (if or_FIXME or_FIXME (or ~@(rest xs))))))))"
 
 argv = Mal::List.new
 REPL_ENV.set("*ARGV*", Mal::Type.new argv)