diff options
Diffstat (limited to 'stdlib/source/lux/data/text/encoding.lux')
-rw-r--r-- | stdlib/source/lux/data/text/encoding.lux | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux index 9e94f25af..1ef044080 100644 --- a/stdlib/source/lux/data/text/encoding.lux +++ b/stdlib/source/lux/data/text/encoding.lux @@ -174,50 +174,50 @@ (with-expansions [<for-jvm> (as-is (host.import: #long java/lang/String (new [[byte] java/lang/String]) (getBytes [java/lang/String] [byte])))] - (`` (for {(~~ (static @.old)) - (as-is <for-jvm>) - - (~~ (static @.jvm)) - (as-is <for-jvm>) - - (~~ (static @.js)) - (as-is (host.import: Uint8Array) - - (host.import: TextEncoder - (new [host.String]) - (encode [host.String] Uint8Array)) - - (host.import: TextDecoder - (new [host.String]) - (decode [Uint8Array] host.String)))}))) + (for {@.old + (as-is <for-jvm>) + + @.jvm + (as-is <for-jvm>) + + @.js + (as-is (host.import: Uint8Array) + + (host.import: TextEncoder + (new [host.String]) + (encode [host.String] Uint8Array)) + + (host.import: TextDecoder + (new [host.String]) + (decode [Uint8Array] host.String)))})) (def: #export (to-utf8 value) (-> Text Binary) - (`` (for {(~~ (static @.old)) - (java/lang/String::getBytes (..name ..utf-8) - ## The coercion below may seem - ## gratuitous, but removing it - ## causes a grave compilation problem. - (:coerce java/lang/String value)) + (for {@.old + (java/lang/String::getBytes (..name ..utf-8) + ## The coercion below may seem + ## gratuitous, but removing it + ## causes a grave compilation problem. + (:coerce java/lang/String value)) - (~~ (static @.jvm)) - (java/lang/String::getBytes (..name ..utf-8) value) + @.jvm + (java/lang/String::getBytes (..name ..utf-8) value) - (~~ (static @.js)) - (|> (TextEncoder::new [(..name ..utf-8)]) - (TextEncoder::encode [value]))}))) + @.js + (|> (TextEncoder::new [(..name ..utf-8)]) + (TextEncoder::encode [value]))})) (def: #export (from-utf8 value) (-> Binary (Try Text)) - (`` (for {(~~ (static @.old)) - (#try.Success (java/lang/String::new value (..name ..utf-8))) + (for {@.old + (#try.Success (java/lang/String::new value (..name ..utf-8))) - (~~ (static @.jvm)) - (#try.Success (java/lang/String::new value (..name ..utf-8))) + @.jvm + (#try.Success (java/lang/String::new value (..name ..utf-8))) - (~~ (static @.js)) - (#try.Success (|> (TextDecoder::new [(..name ..utf-8)]) - (TextDecoder::decode [value])))}))) + @.js + (#try.Success (|> (TextDecoder::new [(..name ..utf-8)]) + (TextDecoder::decode [value])))})) (structure: #export UTF-8 (Codec Binary Text) |