Merge pull request #440 from aasimk2000/add-nil-if-test
[jackhill/mal.git] / crystal / step9_try.cr
index 455c31e..d56f149 100755 (executable)
@@ -246,7 +246,7 @@ 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)))))))"
 
 argv = Mal::List.new