diff options
author | Eduardo Julian | 2019-08-20 22:26:23 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-08-20 22:26:23 -0400 |
commit | 74662caf09a43bf3057f89ea9f3f7c8163e09851 (patch) | |
tree | 4783df3475163298d76e59c1d2ac41fd10eea826 /stdlib/source | |
parent | 59ededb795732e04ac8e1eaceb2b1509a1c1cc23 (diff) |
Renamed "lux/target/jvm/descriptor" to "lux/target/jvm/type/descriptor".
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/target/jvm/type/descriptor.lux (renamed from stdlib/source/lux/target/jvm/descriptor.lux) | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/stdlib/source/lux/target/jvm/descriptor.lux b/stdlib/source/lux/target/jvm/type/descriptor.lux index 5452c16c7..52b5037bc 100644 --- a/stdlib/source/lux/target/jvm/descriptor.lux +++ b/stdlib/source/lux/target/jvm/type/descriptor.lux @@ -14,7 +14,7 @@ ["." template]] [type abstract]] - ["." // #_ + ["." /// #_ [encoding ["#." name (#+ External)]]]) @@ -70,8 +70,8 @@ (def: #export class (-> External (Descriptor Class)) - (|>> //name.internal - //name.read + (|>> ///name.internal + ///name.read (text.enclose [..class-prefix ..class-suffix]) :abstraction)) @@ -102,7 +102,9 @@ (-> (Descriptor Any) Text) (|>> :representation)) - (structure: #export equivalence (All [brand] (Equivalence (Descriptor brand))) + (structure: #export equivalence + (All [brand] (Equivalence (Descriptor brand))) + (def: (= parameter subject) (text@= (:representation parameter) (:representation subject)))) @@ -123,17 +125,18 @@ (|> descriptor :transmutation #.Right) (|> descriptor :transmutation #.Left))) + (def: binary-name (|>> ///name.internal ///name.external)) + (def: #export (class? descriptor) (-> (Descriptor Value) (Maybe Text)) (let [repr (:representation descriptor)] (if (and (text.starts-with? ..class-prefix repr) (text.ends-with? ..class-suffix repr)) - (:: maybe.monad map - (|>> //name.internal //name.external) + (|> repr (text.clip (text.size ..class-prefix) (n.- (text.size ..class-suffix) - (text.size repr)) - repr)) + (text.size repr))) + (:: maybe.monad map ..binary-name)) #.None))) (def: #export class-name @@ -148,7 +151,6 @@ (text.clip prefix-size (n.- suffix-size (text.size repr))) - (:: maybe.monad map - (|>> //name.internal //name.external)) + (:: maybe.monad map ..binary-name) maybe.assume)))))) ) |