aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/text.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/data/text.lux')
-rw-r--r--stdlib/source/library/lux/data/text.lux48
1 files changed, 25 insertions, 23 deletions
diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux
index ecc17837e..8e9eccac7 100644
--- a/stdlib/source/library/lux/data/text.lux
+++ b/stdlib/source/library/lux/data/text.lux
@@ -184,29 +184,31 @@
[[pre post] (..split_by pattern template)]
(in (all "lux text concat" pre replacement post)))))
-(for @.js (these (macro: (defined? tokens lux)
- (case tokens
- (pattern (list it))
- {.#Right [lux (list (` (.case ("js type-of" ("js constant" (~ it)))
- "undefined"
- .false
-
- (~' _)
- .true)))]}
-
- _
- {.#Left ""}))
- (macro: (if_nashorn tokens lux)
- (case tokens
- (pattern (list then else))
- {.#Right [lux (list (if (and (..defined? "java")
- (..defined? "java.lang")
- (..defined? "java.lang.Object"))
- then
- else))]}
-
- _
- {.#Left ""})))
+(for @.js (these (def: defined?
+ (macro (_ tokens lux)
+ (case tokens
+ (pattern (list it))
+ {.#Right [lux (list (` (.case ("js type-of" ("js constant" (~ it)))
+ "undefined"
+ .false
+
+ (~' _)
+ .true)))]}
+
+ _
+ {.#Left ""})))
+ (def: if_nashorn
+ (macro (_ tokens lux)
+ (case tokens
+ (pattern (list then else))
+ {.#Right [lux (list (if (and (..defined? "java")
+ (..defined? "java.lang")
+ (..defined? "java.lang.Object"))
+ then
+ else))]}
+
+ _
+ {.#Left ""}))))
(these))
(def: .public (replaced pattern replacement template)