(;module: lux (lux (control monad) (data text/format) [meta "meta/" Monad]) (luxc ["&" lang] (lang [";L" host] (host ["$" jvm] (jvm ["$i" inst] ["$t" type])) ["la" analysis] ["ls" synthesis] (translation [";T" common]))) [../runtime]) (def: #export translate-unit (Meta $;Inst) (meta/wrap ($i;string hostL;unit))) (def: #export (translate-bool value) (-> Bool (Meta $;Inst)) (meta/wrap ($i;GETSTATIC "java.lang.Boolean" (if value "TRUE" "FALSE") ($t;class "java.lang.Boolean" (list))))) (do-template [ ] [(def: #export ( value) (-> (Meta $;Inst)) (meta/wrap (|>. ( value) )))] [translate-nat Nat (|>. (:! Int) $i;long) ($i;wrap #$;Long)] [translate-int Int $i;long ($i;wrap #$;Long)] [translate-deg Deg (|>. (:! Int) $i;long) ($i;wrap #$;Long)] [translate-frac Frac $i;double ($i;wrap #$;Double)] [translate-text Text $i;string id] )