diff options
Diffstat (limited to '')
-rw-r--r-- | input/lux.lux (renamed from source/lux.lux) | 26 | ||||
-rw-r--r-- | input/program.lux (renamed from source/program.lux) | 2 |
2 files changed, 16 insertions, 12 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 diff --git a/source/program.lux b/input/program.lux index 364c57d89..4f329c3fa 100644 --- a/source/program.lux +++ b/input/program.lux @@ -11,5 +11,5 @@ (list& x (filter p xs')) (filter p xs')))) -(_jvm_program _ +(_jvm_program args (println "Hello, world!")) |