From a51eadf7065db89ac9a65ee854f6f134c9f9da60 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 21 Aug 2019 22:05:16 -0400 Subject: A unified type module to tie together the different JVM kinds of type. --- stdlib/source/lux/target/jvm/type.lux | 416 +++++++++++++++++----------------- 1 file changed, 209 insertions(+), 207 deletions(-) (limited to 'stdlib/source') diff --git a/stdlib/source/lux/target/jvm/type.lux b/stdlib/source/lux/target/jvm/type.lux index a74fab40a..4a2260aef 100644 --- a/stdlib/source/lux/target/jvm/type.lux +++ b/stdlib/source/lux/target/jvm/type.lux @@ -12,214 +12,216 @@ ["." text ("#@." equivalence) ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]]] + ["." list ("#@." functor)]]] + [type + abstract]] ["." // #_ [encoding - ["#." name]]]) - -(template [ ] - [(def: #export )] - - ["V" void-descriptor] - ["Z" boolean-descriptor] - ["B" byte-descriptor] - ["S" short-descriptor] - ["I" int-descriptor] - ["J" long-descriptor] - ["F" float-descriptor] - ["D" double-descriptor] - ["C" char-descriptor] + ["#." name (#+ External)]]] + ["." / #_ + ["#." signature (#+ Signature)] + ["#." descriptor (#+ Descriptor)] + ["#." reflection (#+ Reflection)]]) + +(abstract: #export Void' {} Any) +(abstract: #export (Value' kind) {} Any) +(abstract: #export (Return' kind) {} Any) +(abstract: #export Method {} Any) + +(abstract: #export (Type brand) + {} + + [(Signature Any) (Descriptor Any) (Reflection Any)] + + (type: #export Return (<| Return' Any)) + (type: #export Value (<| Return' Value' Any)) + (type: #export Void (<| Return' Void')) + + (abstract: #export (Object' brand) {} Any) + (type: #export Object (<| Return' Value' Object' Any)) + + (abstract: #export (Parameter' brand) {} Any) + (type: #export Parameter (<| Return' Value' Object' Parameter' Any)) + + (template [ ] + [(with-expansions [ (template.identifier [ "'"])] + (abstract: #export {} Any) + (type: #export + (`` (<| Return' Value' (~~ (template.splice )) ))))] + + [[] Primitive] + [[Object' Parameter'] Class] + [[Object'] Array] + ) + + (template [