diff options
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)))))) ) |