aboutsummaryrefslogtreecommitdiff
path: root/src/lux.clj
diff options
context:
space:
mode:
authorEduardo Julian2015-09-27 01:07:18 -0400
committerEduardo Julian2015-09-27 01:07:18 -0400
commitaa3b52309f2e920688d56b0b00ba12040bf0e841 (patch)
treebe8d7e1bbfeaef29331e6e9eee224b2d2653ddcb /src/lux.clj
parent506ec627005cca8a2e6f7c4fcf374634be3653de (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 '')
-rw-r--r--src/lux.clj28
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")
)