All: *ARGV* and *host-language*. Misc syncing/fixes.
[jackhill/mal.git] / mal / step3_env.mal
index c812f17..6677b04 100644 (file)
 (env-set repl-env "*" *)
 (env-set repl-env "/" /)
 
-(def! -main (fn* [] 
+;; repl loop
+(def! repl-loop (fn* []
   (let* [line (readline "mal-user> ")]
     (if line
       (do
         (if (not (= "" line))
           (try*
-            (let* [res (rep line)]
-              (println res))
+            (println (rep line))
             (catch* exc
               (println "Uncaught exception:" exc))))
-        (-main))))))
+        (repl-loop))))))
+
+(def! -main (fn* [& args] 
+  (repl-loop)))
 (-main)