aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/target/jvm/constant.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-08-24 05:23:45 -0400
committerEduardo Julian2021-08-24 05:23:45 -0400
commit36303d6cb2ce3ab9e36d045b9516c997bd461862 (patch)
treeb9d2f1495143054d61d9af129f36833624db9dac /stdlib/source/library/lux/target/jvm/constant.lux
parentec1f31b5a1492d5e0ab260397291d4449483bbd9 (diff)
Outsourced the syntax for labelled type definitions to macros.
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/target/jvm/constant.lux47
1 files changed, 26 insertions, 21 deletions
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<kind>))
(template [<constructor> <type> <marker>]
- [(type: .public <type> (Value <marker>))
+ [(type: .public <type>
+ (Value <marker>))
(def: .public <constructor>
(-> <marker> <type>)
@@ -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 [<type> <equivalence> <writer>]
[(def: .public <equivalence>
@@ -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 [<case> <tag> <writer>]
[(<case> value)
- (binaryF\compose (/tag.writer <tag>)
- (<writer> value))])
+ (binaryF\composite (/tag.writer <tag>)
+ (<writer> value))])
(<constants>)
))))