From a79927892174c3564c83a0e741e5cc0aaaeeb37c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 30 Jun 2017 18:43:07 -0400 Subject: - WIP: Added generation for common procedures. --- new-luxc/source/luxc/generator/primitive.jvm.lux | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'new-luxc/source/luxc/generator/primitive.jvm.lux') diff --git a/new-luxc/source/luxc/generator/primitive.jvm.lux b/new-luxc/source/luxc/generator/primitive.jvm.lux index 18ce2e24a..c444f791d 100644 --- a/new-luxc/source/luxc/generator/primitive.jvm.lux +++ b/new-luxc/source/luxc/generator/primitive.jvm.lux @@ -10,18 +10,25 @@ ["&;" synthesizer] (generator ["&;" common] (host ["$" jvm] - (jvm ["$i" inst]))))) + (jvm ["$i" inst] + ["$t" type])))) + [../runtime]) (def: #export generate-unit (Lux $;Inst) - (Lux/wrap ($i;string &common;unit))) + (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-bool Bool $i;boolean $i;wrap-boolean] [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] -- cgit v1.2.3