aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/debug.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/debug.lux')
-rw-r--r--stdlib/source/library/lux/debug.lux36
1 files changed, 18 insertions, 18 deletions
diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux
index ad5fa71fb..88df6bc7b 100644
--- a/stdlib/source/library/lux/debug.lux
+++ b/stdlib/source/library/lux/debug.lux
@@ -148,7 +148,7 @@
Inspector
(with_expansions [<jvm> (let [object (as java/lang/Object value)]
(`` (<| (,, (with_template [<class> <processing>]
- [(case (ffi.as <class> object)
+ [(when (ffi.as <class> object)
{.#Some value}
(`` (|> value (,, (template.spliced <processing>))))
@@ -159,16 +159,16 @@
[java/lang/Number [java/lang/Number::doubleValue ffi.of_double %.frac]]
[java/lang/String [ffi.of_string %.text]]
))
- (case (ffi.as [java/lang/Object] object)
+ (when (ffi.as [java/lang/Object] object)
{.#Some value}
(let [value (as (array.Array java/lang/Object) value)]
- (case (array.item 0 value)
+ (when (array.item 0 value)
(^.multi {.#Some tag}
[(ffi.as java/lang/Integer tag)
{.#Some tag}]
[[(array.item 1 value) (array.item 2 value)]
[last? {.#Some choice}]])
- (let [last? (case last?
+ (let [last? (when last?
{.#Some _} #1
{.#None} #0)]
(|> (%.format (%.nat (.nat (ffi.of_long (java/lang/Integer::longValue tag))))
@@ -184,7 +184,7 @@
@.jvm <jvm>
@.js
- (case (ffi.type_of value)
+ (when (ffi.type_of value)
(^.with_template [<type_of> <then>]
[<type_of>
(`` (|> value (,, (template.spliced <then>))))])
@@ -219,7 +219,7 @@
(JSON::stringify value))
@.python
- (case (..str (..type value))
+ (when (..str (..type value))
(^.with_template [<type_of> <class_of> <then>]
[(^.or <type_of> <class_of>)
(`` (|> value (,, (template.spliced <then>))))])
@@ -234,7 +234,7 @@
(^.or "<type 'tuple'>" "<class 'tuple'>")
(let [variant (as (array.Array Any) value)]
- (case (array.size variant)
+ (when (array.size variant)
3 (let [variant_tag ("python array read" 0 variant)
variant_flag ("python array read" 1 variant)
variant_value ("python array read" 2 variant)]
@@ -251,7 +251,7 @@
(..str value))
@.lua
- (case (..type value)
+ (when (..type value)
(^.with_template [<type_of> <then>]
[<type_of>
(`` (|> value (,, (template.spliced <then>))))])
@@ -260,7 +260,7 @@
["nil" [(pipe.new "nil" [])]])
"number"
- (case (math::type value)
+ (when (math::type value)
{.#Some "integer"} (|> value (as .Int) %.int)
{.#Some "float"} (|> value (as .Frac) %.frac)
@@ -324,7 +324,7 @@
(to_s value)))))
@.php
- (case (..gettype value)
+ (when (..gettype value)
(^.with_template [<type_of> <then>]
[<type_of>
(`` (|> value (,, (template.spliced <then>))))])
@@ -451,14 +451,14 @@
(let [[lefts right? sub_repr] (loop (again [lefts 0
representations membersR+
variantV variantV])
- (case representations
+ (when representations
{.#Item leftR {.#Item rightR extraR+}}
- (case (as (Or Any Any) variantV)
+ (when (as (Or Any Any) variantV)
{.#Left left}
[lefts #0 (leftR left)]
{.#Right right}
- (case extraR+
+ (when extraR+
{.#End}
[lefts #1 (rightR right)]
@@ -476,7 +476,7 @@
(in (function (_ tupleV)
(let [tuple_body (loop (again [representations membersR+
tupleV tupleV])
- (case representations
+ (when representations
{.#End}
""
@@ -500,7 +500,7 @@
(do <>.monad
[[funcT inputsT+] (<type>.applied (<>.and <type>.any (<>.many <type>.any)))]
- (case (type.applied inputsT+ funcT)
+ (when (type.applied inputsT+ funcT)
{.#Some outputT}
(<type>.local (list outputT) representation)
@@ -516,7 +516,7 @@
(def .public (representation type value)
(-> Type Any (Try Text))
- (case (<type>.result ..representation_parser type)
+ (when (<type>.result ..representation_parser type)
{try.#Success representation}
{try.#Success (representation value)}
@@ -576,7 +576,7 @@
list.reversed
(dictionary.of_list text.hash))]
targets (is (Meta (List Target))
- (case targets
+ (when targets
{.#End}
(|> environment
dictionary.keys
@@ -594,7 +594,7 @@
(exception.report
(.list (,* (|> targets
(list#each (function (_ [name format])
- (let [format (case format
+ (let [format (when format
{.#None}
(` ..inspection)