diff options
author | Eduardo Julian | 2015-09-27 01:07:18 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-09-27 01:07:18 -0400 |
commit | aa3b52309f2e920688d56b0b00ba12040bf0e841 (patch) | |
tree | be8d7e1bbfeaef29331e6e9eee224b2d2653ddcb /src/lux.clj | |
parent | 506ec627005cca8a2e6f7c4fcf374634be3653de (diff) |
- Lux programs can now use libraries for both the JVM (.jar files) and pure Lux code (.tar.gz files).
- Fixed a bug regarding indices and loading/storing from/to arrays.
Diffstat (limited to 'src/lux.clj')
-rw-r--r-- | src/lux.clj | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/lux.clj b/src/lux.clj index 03d09ebba..8cd2c4b80 100644 --- a/src/lux.clj +++ b/src/lux.clj @@ -5,17 +5,29 @@ (ns lux (:gen-class) - (:require [lux.base :as &] + (:require [lux.base :as & :refer [|let |do return fail return* fail* |case]] + [lux.compiler.base :as &compiler-base] [lux.compiler :as &compiler] - :reload-all)) + [lux.packager.lib :as &lib] + :reload-all) + (:import (java.io File))) -(defn -main [& [program-module & _]] - (if program-module - (time (&compiler/compile-program program-module)) - (println "Please provide a module name to compile.")) - (System/exit 0) +(defn -main [& args] + (|case (&/->list args) + (&/$Cons "compile" (&/$Cons program-module (&/$Nil))) + (if program-module + (time (&compiler/compile-program program-module)) + (println "Please provide a module name to compile.")) + + (&/$Cons "lib" (&/$Cons lib-module (&/$Nil))) + (&lib/package lib-module (new File &compiler-base/input-dir)) + + _ + (println "Can't understand command.")) + ;; (System/exit 0) ) (comment - (-main "program") + (-main "compile" "program") + (-main "lib" "lux") ) |