From 36303d6cb2ce3ab9e36d045b9516c997bd461862 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 24 Aug 2021 05:23:45 -0400 Subject: Outsourced the syntax for labelled type definitions to macros. --- stdlib/source/library/lux/target/jvm/constant.lux | 47 +++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'stdlib/source/library/lux/target/jvm/constant.lux') diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index 5916d245d..c2756715e 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -34,7 +34,8 @@ [encoding ["#." unsigned]]]]) -(type: .public UTF8 Text) +(type: .public UTF8 + Text) (def: utf8_writer (Writer UTF8) @@ -55,7 +56,7 @@ (def: .public class_equivalence (Equivalence Class) - (\ equivalence.functor map + (\ equivalence.functor each ..index //index.equivalence)) @@ -97,12 +98,13 @@ (All [kind] (-> (Equivalence kind) (Equivalence (Value kind)))) - (\ equivalence.functor map + (\ equivalence.functor each (|>> :representation) Equivalence)) (template [ ] - [(type: .public (Value )) + [(type: .public + (Value )) (def: .public (-> ) @@ -131,12 +133,14 @@ ) (type: .public (Name_And_Type of) - {#name (Index UTF8) - #descriptor (Index (Descriptor of))}) + (Record + {#name (Index UTF8) + #descriptor (Index (Descriptor of))})) (type: .public (Reference of) - {#class (Index Class) - #name_and_type (Index (Name_And_Type of))}) + (Record + {#class (Index Class) + #name_and_type (Index (Name_And_Type of))})) (template [ ] [(def: .public @@ -156,17 +160,18 @@ ) (type: .public Constant - (#UTF8 UTF8) - (#Integer Integer) - (#Float Float) - (#Long Long) - (#Double Double) - (#Class Class) - (#String String) - (#Field (Reference //category.Value)) - (#Method (Reference //category.Method)) - (#Interface_Method (Reference //category.Method)) - (#Name_And_Type (Name_And_Type Any))) + (Variant + (#UTF8 UTF8) + (#Integer Integer) + (#Float Float) + (#Long Long) + (#Double Double) + (#Class Class) + (#String String) + (#Field (Reference //category.Value)) + (#Method (Reference //category.Method)) + (#Interface_Method (Reference //category.Method)) + (#Name_And_Type (Name_And_Type Any)))) (def: .public (size constant) (-> Constant Nat) @@ -244,7 +249,7 @@ (case value (^template [ ] [( value) - (binaryF\compose (/tag.writer ) - ( value))]) + (binaryF\composite (/tag.writer ) + ( value))]) () )))) -- cgit v1.2.3