diff options
author | Eduardo Julian | 2015-07-25 18:02:26 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-07-25 18:02:26 -0400 |
commit | 6c51e5e50aa98bb26a3e2b34f57a0e24f8537d93 (patch) | |
tree | 25e1d19939c788e897f01eea7027326c2ff58de7 /input | |
parent | 23b51269d8d0e1d756d019a6bf28ec24b6a507e1 (diff) |
/cache and /output now using same format.
Diffstat (limited to '')
-rw-r--r-- | input/lux.lux | 48 |
1 files changed, 10 insertions, 38 deletions
diff --git a/input/lux.lux b/input/lux.lux index 3bd4d58d0..61d99396c 100644 --- a/input/lux.lux +++ b/input/lux.lux @@ -2187,14 +2187,9 @@ _ (;return (: (List Syntax) - (list:++ (map (lambda [m-name] - (exec (_jvm_invokevirtual java.io.PrintStream print [java.lang.Object] - (_jvm_getstatic java.lang.System out) [($ text:++ "lux;import " m-name "\n")]) - (` (_lux_import (~ (text$ m-name)))))) + (list:++ (map (lambda [m-name] (` (_lux_import (~ (text$ m-name))))) unknowns) - (exec (_jvm_invokevirtual java.io.PrintStream print [java.lang.Object] - (_jvm_getstatic java.lang.System out) ["\n"]) - (list (` (import (~@ tokens))))))))))) + (list (` (import (~@ tokens)))))))))) (def (some f xs) (All [a b] @@ -2388,13 +2383,6 @@ #;None (f x2) (#;Some y) (#;Some y))) -(def (try-both% x1 x2) - (All [a b] - (-> (Maybe a) (Maybe a) (Maybe a))) - (case x1 - #;None x2 - (#;Some _) x1)) - (def (find-in-env name state) (-> Ident Compiler (Maybe Type)) (let [vname' (ident->text name)] @@ -2406,30 +2394,14 @@ (lambda [env] (case env {#name _ #inner-closures _ #locals {#counter _ #mappings locals} #closure {#counter _ #mappings closure}} - (try-both% (some (: (-> (, Text (, LuxVar Type)) (Maybe Type)) - (lambda [binding] - (let [[bname [_ type]] binding] - (if (text:= vname' bname) - (#Some type) - #None)))) - locals) - (some (: (-> (, Text (, LuxVar Type)) (Maybe Type)) - (lambda [binding] - (let [[bname [_ type]] binding] - (if (text:= vname' bname) - (#Some type) - #None)))) - closure)) - ## (some (: (-> (, Text (, LuxVar Type)) (Maybe Type)) - ## (lambda [binding] - ## (let [[bname [_ type]] binding] - ## (exec (_jvm_invokevirtual java.io.PrintStream print [java.lang.Object] - ## (_jvm_getstatic java.lang.System out) [($ text:++ "find-in-env #2: " bname "\n")]) - ## (if (text:= vname' bname) - ## (#Some type) - ## #None))))) - ## locals) - ))) + (try-both (some (: (-> (, Text (, LuxVar Type)) (Maybe Type)) + (lambda [binding] + (let [[bname [_ type]] binding] + (if (text:= vname' bname) + (#Some type) + #None))))) + locals + closure)))) envs)))) (def (show-envs envs) |