From b4d0eba7485caf0c6cf58de1193a9114fa273d8b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 30 May 2020 15:19:28 -0400 Subject: Split new-luxc into lux-jvm and lux-r. --- .../source/luxc/lang/translation/jvm/primitive.lux | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lux-jvm/source/luxc/lang/translation/jvm/primitive.lux (limited to 'lux-jvm/source/luxc/lang/translation/jvm/primitive.lux') diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux new file mode 100644 index 000000000..873c363bd --- /dev/null +++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux @@ -0,0 +1,30 @@ +(.module: + [lux (#- i64) + [target + [jvm + ["." type]]] + [tool + [compiler + [phase ("operation@." monad)]]]] + [luxc + [lang + [host + ["." jvm (#+ Inst Operation) + ["_" inst]]]]]) + +(def: #export bit + (-> Bit (Operation Inst)) + (let [Boolean (type.class "java.lang.Boolean" (list))] + (function (_ value) + (operation@wrap (_.GETSTATIC Boolean (if value "TRUE" "FALSE") Boolean))))) + +(template [ ] + [(def: #export ( value) + (-> (Operation Inst)) + (let [loadI (|> value )] + (operation@wrap (|>> loadI ))))] + + [i64 (I64 Any) (<| _.long .int) (_.wrap type.long)] + [f64 Frac _.double (_.wrap type.double)] + [text Text _.string (<|)] + ) -- cgit v1.2.3