diff options
Diffstat (limited to 'stdlib/source/lux/debug.lux')
-rw-r--r-- | stdlib/source/lux/debug.lux | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/stdlib/source/lux/debug.lux b/stdlib/source/lux/debug.lux index bac74880f..f46c3334b 100644 --- a/stdlib/source/lux/debug.lux +++ b/stdlib/source/lux/debug.lux @@ -48,17 +48,17 @@ (intValue [] int) (longValue [] long) (doubleValue [] double)))] - (`` (for {(~~ (static @.old)) - (as-is <for-jvm>) + (for {@.old + (as-is <for-jvm>) - (~~ (static @.jvm)) - (as-is <for-jvm>) + @.jvm + (as-is <for-jvm>) - (~~ (static @.js)) - (as-is (import: JSON - (#static stringify [.Any] host.String)) - (import: Array - (#static isArray [.Any] host.Boolean)))}))) + @.js + (as-is (import: JSON + (#static stringify [.Any] host.String)) + (import: Array + (#static isArray [.Any] host.Boolean)))})) (def: Inspector (-> Any Text)) @@ -107,47 +107,47 @@ (inspect-tuple inspect value))) #.None) (java/lang/Object::toString object))))] - (`` (for {(~~ (static @.old)) - <for-jvm> - - (~~ (static @.jvm)) - <for-jvm> - - (~~ (static @.js)) - (~~ (case (host.type-of value) - (^template [<type-of> <then>] - <type-of> - (`` (|> value (~~ (template.splice <then>))))) - (["boolean" [(:coerce .Bit) %.bit]] - ["string" [(:coerce .Text) %t]] - ["number" [(:coerce .Frac) %f]] - ["undefined" [JSON::stringify]]) + (for {@.old + <for-jvm> + + @.jvm + <for-jvm> + + @.js + (case (host.type-of value) + (^template [<type-of> <then>] + <type-of> + (`` (|> value (~~ (template.splice <then>))))) + (["boolean" [(:coerce .Bit) %.bit]] + ["string" [(:coerce .Text) %t]] + ["number" [(:coerce .Frac) %f]] + ["undefined" [JSON::stringify]]) + + "object" + (let [variant-tag ("js object get" "_lux_tag" value) + variant-flag ("js object get" "_lux_flag" value) + variant-value ("js object get" "_lux_value" value)] + (cond (not (or ("js object undefined?" variant-tag) + ("js object undefined?" variant-flag) + ("js object undefined?" variant-value))) + (|> (format (JSON::stringify variant-tag) + " " (%.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) %.int) + + (Array::isArray value) + (inspect-tuple inspect value) - "object" - (let [variant-tag ("js object get" "_lux_tag" value) - variant-flag ("js object get" "_lux_flag" value) - variant-value ("js object get" "_lux_value" value)] - (cond (not (or ("js object undefined?" variant-tag) - ("js object undefined?" variant-flag) - ("js object undefined?" variant-value))) - (|> (format (JSON::stringify variant-tag) - " " (%.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) %.int) - - (Array::isArray value) - (inspect-tuple inspect value) - - ## else - (JSON::stringify value))) - - _ - (undefined))) - })))) + ## else + (JSON::stringify value))) + + _ + (undefined)) + }))) (exception: #export (cannot-represent-value {type Type}) (exception.report |