aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/macro/pattern.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/macro/pattern.lux')
-rw-r--r--stdlib/source/library/lux/macro/pattern.lux46
1 files changed, 23 insertions, 23 deletions
diff --git a/stdlib/source/library/lux/macro/pattern.lux b/stdlib/source/library/lux/macro/pattern.lux
index 65b469e2d..affa8273a 100644
--- a/stdlib/source/library/lux/macro/pattern.lux
+++ b/stdlib/source/library/lux/macro/pattern.lux
@@ -3,15 +3,15 @@
[lux (.except or let with_template |> `)]])
(def partial_list
- (`` ("lux in-module" (~~ (static .prelude)) .partial_list)))
+ (`` ("lux in-module" (,, (static .prelude)) .partial_list)))
(def locally
(macro (_ tokens lux)
(.let [[prelude _] (symbol ._)]
(case tokens
(pattern (list [@ {.#Symbol ["" name]}]))
- {.#Right [lux (list (.` ("lux in-module" (~ [@ {.#Text prelude}])
- (~ [@ {.#Symbol [prelude name]}]))))]}
+ {.#Right [lux (list (.` ("lux in-module" (, [@ {.#Text prelude}])
+ (, [@ {.#Symbol [prelude name]}]))))]}
_
{.#Left ""}))))
@@ -133,17 +133,17 @@
expected ..expected_type
g!temp (..generated_symbol "temp")]
(in (list g!temp
- (.` ({{.#Some (~ g!temp)}
- (~ g!temp)
+ (.` ({{.#Some (, g!temp)}
+ (, g!temp)
{.#None}
- (.case (~ g!temp)
- (~+ next_branches))}
- ("lux type check" {.#Apply (~ (type_code expected)) Maybe}
- (.case (~ g!temp)
- (~+ (multi_level_case$ g!temp [mlc body]))
+ (.case (, g!temp)
+ (,* next_branches))}
+ ("lux type check" {.#Apply (, (type_code expected)) Maybe}
+ (.case (, g!temp)
+ (,* (multi_level_case$ g!temp [mlc body]))
- (~+ (if initial_bind?
+ (,* (if initial_bind?
(list)
(list g!temp (.` {.#None})))))))))))
@@ -156,7 +156,7 @@
(pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] pattern)}] body branches))
(.let [g!whole (local$ name)]
(meta#in (partial_list g!whole
- (.` (case (~ g!whole) (~ pattern) (~ body)))
+ (.` (case (, g!whole) (, pattern) (, body)))
branches)))
_
@@ -168,8 +168,8 @@
(pattern (partial_list [_meta {.#Form (list [_ {.#Symbol ["" name]}] [_ {.#Tuple steps}])}] body branches))
(.let [g!name (local$ name)]
(meta#in (partial_list g!name
- (.` (.let [(~ g!name) (.|> (~ g!name) (~+ steps))]
- (~ body)))
+ (.` (.let [(, g!name) (.|> (, g!name) (,* steps))]
+ (, body)))
branches)))
_
@@ -177,7 +177,7 @@
(def (name$ [module name])
(-> Symbol Code)
- (.` [(~ (text$ module)) (~ (text$ name))]))
+ (.` [(, (text$ module)) (, (text$ name))]))
(def (untemplated_partial_list last inits)
(-> Code (List Code) Code)
@@ -186,23 +186,23 @@
last
{.#Item [init inits']}
- (.` {.#Item (~ init) (~ (untemplated_partial_list last inits'))})))
+ (.` {.#Item (, init) (, (untemplated_partial_list last inits'))})))
(.with_template [<tag> <name>]
[(def (<name> g!meta untemplated_pattern elems)
(-> Code (-> Code (Meta Code))
(-> (List Code) (Meta Code)))
(case (list#reversed elems)
- {.#Item [_ {.#Form {.#Item [[_ {.#Symbol ["" "~+"]}] {.#Item [spliced {.#End}]}]}}]
+ {.#Item [_ {.#Form {.#Item [[_ {.#Symbol ["" ",*"]}] {.#Item [spliced {.#End}]}]}}]
inits}
(do meta#monad
[=inits (monad#each meta#monad untemplated_pattern (list#reversed inits))]
- (in (.` [(~ g!meta) {<tag> (~ (untemplated_partial_list spliced =inits))}])))
+ (in (.` [(, g!meta) {<tag> (, (untemplated_partial_list spliced =inits))}])))
_
(do meta#monad
[=elems (monad#each meta#monad untemplated_pattern elems)]
- (in (.` [(~ g!meta) {<tag> (~ (untemplated_list =elems))}])))))]
+ (in (.` [(, g!meta) {<tag> (, (untemplated_list =elems))}])))))]
[.#Form untemplated_form]
[.#Variant untemplated_variant]
@@ -216,7 +216,7 @@
(case pattern
(..with_template [<tag> <gen>]
[[_ {<tag> value}]
- (in (.` [(~ g!meta) {<tag> (~ (<gen> value))}]))])
+ (in (.` [(, g!meta) {<tag> (, (<gen> value))}]))])
([.#Bit bit$]
[.#Nat nat$]
[.#Int int$]
@@ -225,11 +225,11 @@
[.#Text text$]
[.#Symbol name$])
- [_ {.#Form {.#Item [[_ {.#Symbol ["" "~"]}] {.#Item [unquoted {.#End}]}]}}]
+ [_ {.#Form {.#Item [[_ {.#Symbol ["" ","]}] {.#Item [unquoted {.#End}]}]}}]
(in unquoted)
- [_ {.#Form {.#Item [[_ {.#Symbol ["" "~+"]}] {.#Item [spliced {.#End}]}]}}]
- (failure "Cannot use (~+) inside of `code` unless it is the last element in a form or a tuple.")
+ [_ {.#Form {.#Item [[_ {.#Symbol ["" ",*"]}] {.#Item [spliced {.#End}]}]}}]
+ (failure "Cannot use (,*) inside of `code` unless it is the last element in a form or a tuple.")
(..with_template [<tag> <untemplated>]
[[_ {<tag> elems}]