diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/debug.lux | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/stdlib/source/lux/debug.lux b/stdlib/source/lux/debug.lux index 316617d84..6a4c208fa 100644 --- a/stdlib/source/lux/debug.lux +++ b/stdlib/source/lux/debug.lux @@ -14,7 +14,7 @@ [data ["." error (#+ Error)] ["." text - format] + ["%" format (#+ format)]] [format [xml (#+ XML)] ["." json]] @@ -79,10 +79,10 @@ (`` (|> value (~~ (template.splice <processing>)))) #.None)] - [java/lang/Boolean [(:coerce .Bit) %b]] - [java/lang/String [(:coerce .Text) %t]] - [java/lang/Long [(:coerce .Int) %i]] - [java/lang/Number [java/lang/Number::doubleValue %f]] + [java/lang/Boolean [(:coerce .Bit) %.bit]] + [java/lang/String [(:coerce .Text) %.text]] + [java/lang/Long [(:coerce .Int) %.int]] + [java/lang/Number [java/lang/Number::doubleValue %.frac]] )) (case (host.check [java/lang/Object] object) (#.Some value) @@ -98,8 +98,8 @@ (let [last? (case last? (#.Some _) #1 #.None #0)] - (|> (format (%n (.nat (java/lang/Integer::longValue tag))) - " " (%b last?) + (|> (format (%.nat (.nat (java/lang/Integer::longValue tag))) + " " (%.bit last?) " " (inspect choice)) (text.enclose ["(" ")"]))) @@ -118,7 +118,7 @@ (^template [<type-of> <then>] <type-of> (`` (|> value (~~ (template.splice <then>))))) - (["boolean" [(:coerce .Bit) %b]] + (["boolean" [(:coerce .Bit) %.bit]] ["string" [(:coerce .Text) %t]] ["number" [(:coerce .Frac) %f]] ["undefined" [JSON::stringify]]) @@ -131,13 +131,13 @@ ("js object undefined?" variant-flag) ("js object undefined?" variant-value))) (|> (format (JSON::stringify variant-tag) - " " (%b (not ("js object null?" variant-flag))) + " " (%.bit (not ("js object null?" variant-flag))) " " (inspect variant-value)) (text.enclose ["(" ")"])) (not (or ("js object undefined?" ("js object get" "_lux_low" value)) ("js object undefined?" ("js object get" "_lux_high" value)))) - (|> value (:coerce .Int) %i) + (|> value (:coerce .Int) %.int) (Array::isArray value) (inspect-tuple inspect value) @@ -151,7 +151,7 @@ (exception: #export (cannot-represent-value {type Type}) (exception.report - ["Type" (%type type)])) + ["Type" (%.type type)])) (type: Representation (-> Any Text)) @@ -167,12 +167,12 @@ [_ (<type>.sub <type>)] (wrap (|>> (:coerce <type>) <formatter>)))] - [Bit %b] - [Nat %n] - [Int %i] - [Rev %r] - [Frac %f] - [Text %t]))))) + [Bit %.bit] + [Nat %.nat] + [Int %.int] + [Rev %.rev] + [Frac %.frac] + [Text %.text]))))) (def: (special-representation representation) (-> (Parser Representation) (Parser Representation)) @@ -182,18 +182,18 @@ [_ (<type>.sub <type>)] (wrap (|>> (:coerce <type>) <formatter>)))] - [Type %type] - [Code %code] - [Instant %instant] - [Duration %duration] - [Date %date] - [json.JSON %json] - [XML %xml])) + [Type %.type] + [Code %.code] + [Instant %.instant] + [Duration %.duration] + [Date %.date] + [json.JSON %.json] + [XML %.xml])) (do <>.monad [[_ elemT] (<type>.apply (<>.and (<type>.exactly List) <type>.any)) elemR (<type>.local (list elemT) representation)] - (wrap (|>> (:coerce (List Any)) (%list elemR)))) + (wrap (|>> (:coerce (List Any)) (%.list elemR)))) (do <>.monad [[_ elemT] (<type>.apply (<>.and (<type>.exactly Maybe) <type>.any)) @@ -229,7 +229,7 @@ _ (undefined)))] - (format "(" (%n lefts) " " (%b right?) " " sub-repr ")")))))) + (format "(" (%.nat lefts) " " (%.bit right?) " " sub-repr ")")))))) (def: (tuple-representation representation) (-> (Parser Representation) (Parser Representation)) |