diff options
Diffstat (limited to 'input')
-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) |