From 6c51e5e50aa98bb26a3e2b34f57a0e24f8537d93 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 25 Jul 2015 18:02:26 -0400 Subject: /cache and /output now using same format. --- input/lux.lux | 48 ++++++++++-------------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) (limited to 'input') 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) -- cgit v1.2.3