diff options
author | Eduardo Julian | 2015-06-20 20:19:02 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-06-20 20:19:02 -0400 |
commit | 5e9e876131901204dd34ce1548a4df3cb6cba95f (patch) | |
tree | 82bb0f7f20fe13f91f15656ed61f28e585b19ced /source/lux.lux | |
parent | 082ef348efef7c4f1941c48f94b58e22fea724a4 (diff) |
- The directory for source-code is now named "input".
- Implemented module-caching to avoid the waiting too much during program compilation.
Diffstat (limited to '')
-rw-r--r-- | input/lux.lux (renamed from source/lux.lux) | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/source/lux.lux b/input/lux.lux index 07b245a5d..6c9a50f9d 100644 --- a/source/lux.lux +++ b/input/lux.lux @@ -7,8 +7,8 @@ ## You must not remove this notice, or any other, from this software. ## First things first, must define functions -(_jvm_interface "lux.Function" [] - (apply ["java.lang.Object"] "java.lang.Object" ["public" "abstract"])) +(_jvm_interface "Function" [] + (apply ["java.lang.Object"] "java.lang.Object" ["public" "abstract"])) ## (_jvm_class "lux.MyFunction" "java.lang.Object" ["lux.Function"] ## [(foo "java.lang.Object" ["public" "static"])] @@ -269,7 +269,8 @@ ## #types (Bindings Int Type) ## #host HostState ## #seed Int -## #seen-sources (List Text))) +## #seen-sources (List Text) +## #eval? Bool)) (_lux_def Compiler (#AppT [(#AllT [(#Some #Nil) "lux;Compiler" "" (#RecordT (#Cons [["lux;source" Reader] @@ -282,7 +283,8 @@ (#Cons [["lux;host" HostState] (#Cons [["lux;seed" Int] (#Cons [["lux;seen-sources" (#AppT [List Text])] - #Nil])])])])])])]))]) + (#Cons [["lux;eval?" Bool] + #Nil])])])])])])])]))]) Void])) (_lux_export Compiler) @@ -1308,7 +1310,7 @@ (_lux_case state {#source source #modules modules #envs envs #types types #host host - #seed seed #seen-sources seen-sources} + #seed seed #seen-sources seen-sources #eval? eval?} (_lux_case (reverse envs) #Nil (#Left "Can't get the module name without a module!") @@ -1347,7 +1349,7 @@ (_lux_case state {#source source #modules modules #envs envs #types types #host host - #seed seed #seen-sources seen-sources} + #seed seed #seen-sources seen-sources #eval? eval?} (#Right [state (find-macro' modules current-module module name)])))))) (def'' (list:join xs) @@ -1757,10 +1759,10 @@ (case state {#source source #modules modules #envs envs #types types #host host - #seed seed #seen-sources seen-sources} + #seed seed #seen-sources seen-sources #eval? eval?} (#Right [{#source source #modules modules #envs envs #types types #host host - #seed (inc seed) #seen-sources seen-sources} + #seed (inc seed) #seen-sources seen-sources #eval? eval?} ($symbol ["__gensym__" (int:show seed)])]))) (def #export (macro-expand-1 token) @@ -1966,7 +1968,7 @@ (case state {#source source #modules modules #envs envs #types types #host host - #seed seed #seen-sources seen-sources} + #seed seed #seen-sources seen-sources #eval? eval?} (case (get "lux" modules) (#Some lux) (let [to-alias (map (: (-> (, Text (, Bool (DefData' (-> (List Syntax) (StateE Compiler (List Syntax)))))) @@ -1974,7 +1976,9 @@ (lambda [gdef] (let [[name [export? _]] gdef] (if export? - (list name) + (exec (_jvm_invokevirtual java.io.PrintStream print [java.lang.Object] + (_jvm_getstatic java.lang.System out) [($ text:++ "Importing: " name "\n")]) + (list name)) (list))))) (let [{#module-aliases _ #defs defs #imports _} lux] defs))] @@ -2061,7 +2065,7 @@ (case state {#source source #modules modules #envs envs #types types #host host - #seed seed #seen-sources seen-sources} + #seed seed #seen-sources seen-sources #eval? eval?} (let [?struct-type (some (: (-> (Env Text (, LuxVar Type)) (Maybe Type)) (lambda [env] (case env |