From 697707d8560a5735be38fd9b1ff91a02c289d48f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 16 Apr 2019 20:53:41 -0400 Subject: Made some new-luxc modules "old". --- .../source/luxc/lang/translation/jvm/primitive.lux | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 new-luxc/source/luxc/lang/translation/jvm/primitive.lux (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 new file mode 100644 index 000000000..f9d9034ea --- /dev/null +++ b/new-luxc/source/luxc/lang/translation/jvm/primitive.lux @@ -0,0 +1,33 @@ +(.module: + [lux (#- i64) + [abstract + monad] + [data + [text + format]] + [tool + [compiler + [phase ("operation/." monad)]]]] + [luxc + [lang + [host + ["." jvm (#+ Inst Operation) + ["_" inst] + ["$t" type]]]]]) + +(def: #export (bit value) + (-> Bit (Operation Inst)) + (operation/wrap (_.GETSTATIC "java.lang.Boolean" + (if value "TRUE" "FALSE") + ($t.class "java.lang.Boolean" (list))))) + +(template [ ] + [(def: #export ( value) + (-> (Operation Inst)) + (let [loadI (|> value )] + (operation/wrap (|>> loadI ))))] + + [i64 (I64 Any) (<| _.long .int) (_.wrap #jvm.Long)] + [f64 Frac _.double (_.wrap #jvm.Double)] + [text Text _.string (<|)] + ) -- cgit v1.2.3