Carp/lisp/boot.carp

32 lines
854 B
Plaintext

(def carp-dir (getenv "CARP_DIR"))
(def carp-dev (not (= "" (getenv "CARP_DEV"))))
(if (= carp-dir "")
(do (println "Environment variable 'CARP_DIR' is not set, did you run 'carp-repl' directly? Please use the carp shell script instead.")
(exit -1))
nil)
(load-lisp (str carp-dir "lisp/core.carp"))
(when carp-dev
(load-lisp (str carp-dir "lisp/core_tests.carp")))
(load-lisp (str carp-dir "lisp/compiler.carp"))
(defn load-gl ()
(load-lisp (str carp-dir "lisp/glfw_test.carp")))
(when carp-dev
(do
(load-lisp (str carp-dir "lisp/compiler_tests.carp"))
(load-lisp (str carp-dir "lisp/examples.carp"))
(load-gl)
))
(let [user-boot-file (str (getenv "HOME") "/.carp/user.carp")]
(when (file-exists? user-boot-file)
(load-lisp user-boot-file)))
(when (file-exists? "project.carp")
(load-lisp "project.carp"))