aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/text.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-06-05 01:39:29 -0400
committerEduardo Julian2022-06-05 01:39:29 -0400
commitf623de52d76ad8ec96feb048cd95a3fb150717e1 (patch)
tree92a53eb8e5a25287e59eb104716abe5cc2ebd60a /stdlib/source/library/lux/data/text.lux
parent75e8244fd7914d2ac0c3622d2277b84c4bfa7ffb (diff)
De-sigil-ification: : [Part 1]
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)