aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/macro.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-06-16 00:48:19 -0400
committerEduardo Julian2022-06-16 00:48:19 -0400
commit9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 (patch)
tree115fab5bd8a5f53dc0d13ce5453095324a83496f /stdlib/source/library/lux/macro.lux
parentf92c806ee8da63f04bbefbf558f6249bacdb47ea (diff)
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/macro.lux26
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/macro.lux b/stdlib/source/library/lux/macro.lux
index e7dda08c5..35d94cb88 100644
--- a/stdlib/source/library/lux/macro.lux
+++ b/stdlib/source/library/lux/macro.lux
@@ -18,7 +18,7 @@
["[0]" location]
["[0]" symbol (.open: "[1]#[0]" codec)]]]])
-(def: .public (single_expansion syntax)
+(def .public (single_expansion syntax)
(-> Code (Meta (List Code)))
(case syntax
[_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}]
@@ -34,7 +34,7 @@
_
(at //.monad in (list syntax))))
-(def: .public (expansion syntax)
+(def .public (expansion syntax)
(-> Code (Meta (List Code)))
(case syntax
[_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}]
@@ -54,7 +54,7 @@
_
(at //.monad in (list syntax))))
-(def: .public (full_expansion syntax)
+(def .public (full_expansion syntax)
(-> Code (Meta (List Code)))
(case syntax
[_ {.#Form {.#Item [[_ {.#Symbol name}] args]}}]
@@ -91,7 +91,7 @@
_
(at //.monad in (list syntax))))
-(def: .public (symbol prefix)
+(def .public (symbol prefix)
(-> Text (Meta Code))
(do //.monad
[id //.seed]
@@ -100,7 +100,7 @@
(all text#composite "__gensym__" prefix)
[""] code.symbol))))
-(def: (local ast)
+(def (local ast)
(-> Code (Meta Text))
(case ast
[_ {.#Symbol [_ name]}]
@@ -109,13 +109,13 @@
_
(//.failure (text#composite "Code is not a local symbol: " (code.format ast)))))
-(def: .public wrong_syntax_error
+(def .public wrong_syntax_error
(-> Symbol Text)
(|>> symbol#encoded
(text.prefix (text#composite "Wrong syntax for " text.\''))
(text.suffix (text#composite text.\'' "."))))
-(def: .public with_symbols
+(def .public with_symbols
(.macro (_ tokens)
(case tokens
(pattern (list [_ {.#Tuple symbols}] body))
@@ -131,7 +131,7 @@
_
(//.failure (..wrong_syntax_error (.symbol ..with_symbols))))))
-(def: .public (one_expansion token)
+(def .public (one_expansion token)
(-> Code (Meta Code))
(do //.monad
[token+ (..expansion token)]
@@ -143,7 +143,7 @@
(//.failure "Macro expanded to more than 1 element."))))
(with_template [<macro> <func>]
- [(def: .public <macro>
+ [(def .public <macro>
(.macro (_ tokens)
(let [[module _] (.symbol .._)
[_ short] (.symbol <macro>)
@@ -179,7 +179,7 @@
[log_full_expansion! ..full_expansion]
)
-(def: .public times
+(def .public times
(.macro (_ tokens)
(case tokens
(pattern (list.partial [_ {.#Nat times}] terms))
@@ -199,17 +199,17 @@
_
(//.failure (..wrong_syntax_error (.symbol ..times))))))
-(def: .public final
+(def .public final
(.macro (_ it)
(let [! //.monad]
(|> it
(monad.each ! ..expansion)
(at ! each list#conjoint)))))
-(def: .public function
+(def .public function
(-> Macro Macro')
(|>> (as Macro')))
-(def: .public macro
+(def .public macro
(-> Macro' Macro)
(|>> (as Macro)))