From 59ededb795732e04ac8e1eaceb2b1509a1c1cc23 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 20 Aug 2019 22:00:59 -0400 Subject: WIP: Make new-luxc instructions rely on the Descriptor type. --- new-luxc/source/luxc/lang/translation/jvm/primitive.lux | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/primitive.lux') diff --git a/new-luxc/source/luxc/lang/translation/jvm/primitive.lux b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux index 85fed0a8e..6903b065d 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/primitive.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux @@ -2,6 +2,7 @@ [lux (#- i64) [target [jvm + ["." descriptor] ["$t" type]]] [tool [compiler @@ -12,11 +13,11 @@ ["." jvm (#+ Inst Operation) ["_" inst]]]]]) -(def: #export (bit value) +(def: #export bit (-> Bit (Operation Inst)) - (operation@wrap (_.GETSTATIC "java.lang.Boolean" - (if value "TRUE" "FALSE") - ($t.class "java.lang.Boolean" (list))))) + (let [Boolean (descriptor.class "java.lang.Boolean")] + (function (_ value) + (operation@wrap (_.GETSTATIC Boolean (if value "TRUE" "FALSE") Boolean))))) (template [ ] [(def: #export ( value) @@ -24,7 +25,7 @@ (let [loadI (|> value )] (operation@wrap (|>> loadI ))))] - [i64 (I64 Any) (<| _.long .int) (_.wrap #$t.Long)] - [f64 Frac _.double (_.wrap #$t.Double)] + [i64 (I64 Any) (<| _.long .int) (_.wrap descriptor.long)] + [f64 Frac _.double (_.wrap descriptor.double)] [text Text _.string (<|)] ) -- cgit v1.2.3