(;module: lux (lux (control monad) (data text/format) [macro #+ Monad "Lux/" Monad]) (luxc ["&" base] (lang ["la" analysis] ["ls" synthesis]) ["&;" analyser] ["&;" synthesizer] (generator ["&;" common] (host ["$" jvm] (jvm ["$i" inst] ["$t" type])))) [../runtime]) (def: #export generate-unit (Lux $;Inst) (Lux/wrap ($i;string ../runtime;unit))) (def: #export (generate-bool value) (-> Bool (Lux $;Inst)) (Lux/wrap ($i;GETSTATIC "java.lang.Boolean" (if value "TRUE" "FALSE") ($t;class "java.lang.Boolean" (list))))) (do-template [ ] [(def: #export ( value) (-> (Lux $;Inst)) (Lux/wrap (|>. ( value) )))] [generate-nat Nat (|>. (:! Int) $i;long) $i;wrap-long] [generate-int Int $i;long $i;wrap-long] [generate-deg Deg (|>. (:! Int) $i;long) $i;wrap-long] [generate-real Real $i;double $i;wrap-double] [generate-text Text $i;string id] )