aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/macro/pattern.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-10-19 19:34:33 -0400
committerEduardo Julian2022-10-19 19:34:33 -0400
commit820ffc0a87d7960e62508fc451d9df7a94a6afa7 (patch)
tree33ff1ac227942820f92b43c0a8b872d4e080f974 /stdlib/source/library/lux/meta/macro/pattern.lux
parentd9a1d70ec04fd5796276aeb46038654ade4484f9 (diff)
Migrating default extensions to the new format [Part 2]
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/meta/macro/pattern.lux24
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/library/lux/meta/macro/pattern.lux b/stdlib/source/library/lux/meta/macro/pattern.lux
index f4f352efc..e642b1cd3 100644
--- a/stdlib/source/library/lux/meta/macro/pattern.lux
+++ b/stdlib/source/library/lux/meta/macro/pattern.lux
@@ -21,8 +21,8 @@
(.let [[prelude _] (symbol ._)]
(when tokens
(list [@ {.#Symbol ["" name]}])
- {.#Right [lux (list (.` ("lux in-module" (., [@ {.#Text prelude}])
- (., [@ {.#Symbol [prelude name]}]))))]}
+ {.#Right [lux (list (.` (.in_module# (., [@ {.#Text prelude}])
+ (., [@ {.#Symbol [prelude name]}]))))]}
_
{.#Left ""}))))
@@ -95,7 +95,7 @@
[bindings' (monad.each maybe.monad symbol_short bindings)
data' (monad.each maybe.monad tuple_list data)]
(.let [num_bindings (list.size bindings')]
- (if (list.every? (|>> ("lux i64 =" num_bindings))
+ (if (list.every? (|>> (.i64_=# num_bindings))
(list#each list.size data'))
(.let [apply (is (-> Replacement_Environment (List Code))
(function (_ env) (list#each (realized_template env) templates)))]
@@ -175,19 +175,19 @@
false)]
expected ..expected_type]
(in (list g!temp
- (.` ({{.#Some (., g!temp)}
+ (.` (.when (.is# {.#Apply (., (type_code expected)) Maybe}
+ (.when (., g!temp)
+ (.,* (multiG g!temp [mlc body]))
+
+ (.,* (if initial_bind?
+ (list)
+ (list g!temp (.` {.#None}))))))
+ {.#Some (., g!temp)}
(., g!temp)
{.#None}
(.when (., g!temp)
- (.,* next_branches))}
- ("lux type check" {.#Apply (., (type_code expected)) Maybe}
- (.when (., g!temp)
- (.,* (multiG g!temp [mlc body]))
-
- (.,* (if initial_bind?
- (list)
- (list g!temp (.` {.#None}))))))))))))
+ (.,* next_branches))))))))
_
(///.failure (..wrong_syntax_error (symbol ..multi)))))))