aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-03-30 21:45:45 -0400
committerEduardo Julian2019-03-30 21:45:45 -0400
commit118895081d97279a796cc704e6c23bf92ed79e5e (patch)
tree1ea654e3f913bfc5f978bba46620c535e7a4a7bc /stdlib/source/lux.lux
parent5009bfaa56119a58e675a1e6008623790b54cc1c (diff)
Re-named "do-template" to "template".
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r--stdlib/source/lux.lux44
1 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index ebdf57efb..2c550ebd9 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -2263,11 +2263,11 @@
#1
("lux i64 =" test subject)))
-(macro:' #export (do-template tokens)
+(macro:' #export (template tokens)
(list [(tag$ ["lux" "doc"])
(text$ ($_ "lux text concat"
"## By specifying a pattern (with holes), and the input data to fill those holes, repeats the pattern as many times as necessary." __paragraph
- "(do-template [<name> <diff>]" ..new-line
+ "(template [<name> <diff>]" ..new-line
" " "[(def: #export <name> (-> Int Int) (i/+ <diff>))]" __paragraph
" " "[inc +1]" ..new-line
" " "[dec -1]"))])
@@ -2281,15 +2281,15 @@
(|> data'
(join-map (compose apply (make-env bindings')))
return)
- (fail "Irregular arguments tuples for do-template.")))
+ (fail "Irregular arguments tuples for template.")))
_
- (fail "Wrong syntax for do-template")}
+ (fail "Wrong syntax for template")}
[(monad@map maybe-monad get-short bindings)
(monad@map maybe-monad tuple->list data)])
_
- (fail "Wrong syntax for do-template")}
+ (fail "Wrong syntax for template")}
tokens))
(def:''' #export (r/= test subject)
@@ -2328,7 +2328,7 @@
#1
("lux i64 =" test subject)))
-(do-template [<type>
+(template [<type>
<eq-proc> <lt-proc> <eq-name> <lt-name> <lte-name> <gt-name> <gte-name>
<eq-doc> <<-doc> <<=-doc> <>-doc> <>=-doc>]
[(def:''' #export (<eq-name> test subject)
@@ -2412,7 +2412,7 @@
("lux coerce" Int param))]
("lux i64 -" subject flat)))
-(do-template [<type> <name> <op> <doc>]
+(template [<type> <name> <op> <doc>]
[(def:''' #export (<name> param subject)
(list [(tag$ ["lux" "doc"])
(text$ <doc>)])
@@ -2426,7 +2426,7 @@
[ Rev r/- "lux i64 -" "Rev(olution) substraction."]
)
-(do-template [<type> <name> <op> <doc>]
+(template [<type> <name> <op> <doc>]
[(def:''' #export (<name> param subject)
(list [(tag$ ["lux" "doc"])
(text$ <doc>)])
@@ -2525,7 +2525,7 @@
_ ("lux i64 left-shift" (n/- trailing-zeroes 64) 1)}
trailing-zeroes)))))
-(do-template [<name> <type> <test> <doc>]
+(template [<name> <type> <test> <doc>]
[(def:''' #export (<name> left right)
(list [(tag$ ["lux" "doc"])
(text$ <doc>)])
@@ -2876,7 +2876,7 @@
_ #0}
xs))
-(do-template [<name> <type> <value>]
+(template [<name> <type> <value>]
[(def:''' (<name> xy)
#Nil
(All [a b] (-> (& a b) <type>))
@@ -3569,7 +3569,7 @@
(#Some y)
(#Some y))))
-(do-template [<name> <form> <message> <doc-msg>]
+(template [<name> <form> <message> <doc-msg>]
[(macro: #export (<name> tokens)
{#.doc <doc-msg>}
(case (list@reverse tokens)
@@ -3740,7 +3740,7 @@
_
#None))
-(do-template [<name> <tag>]
+(template [<name> <tag>]
[(def: (<name> type)
(-> Type (List Type))
(case type
@@ -4046,7 +4046,7 @@
(fail "Wrong syntax for type:"))
))
-(do-template [<name> <to>]
+(template [<name> <to>]
[(def: #export (<name> value)
(-> (I64 Any) <to>)
(:coerce <to> value))]
@@ -5110,7 +5110,7 @@
(macro: #export (^template tokens)
{#.doc (text$ ($_ "lux text concat"
- "## It's similar to do-template, but meant to be used during pattern-matching." ..new-line
+ "## It's similar to template, but meant to be used during pattern-matching." ..new-line
"(def: (beta-reduce env type)" ..new-line
" (-> (List Type) Type Type)" ..new-line
" (case type" ..new-line
@@ -5167,7 +5167,7 @@
_
(fail "Wrong syntax for ^template")))
-(do-template [<name> <from> <to> <proc>]
+(template [<name> <from> <to> <proc>]
[(def: #export (<name> n)
(-> <from> <to>)
(<proc> [n]))]
@@ -5220,7 +5220,7 @@
(-> Text Text)
($_ text@compose ..double-quote original ..double-quote))
-(do-template [<name> <extension> <doc>]
+(template [<name> <extension> <doc>]
[(def: #export (<name> value)
{#.doc <doc>}
(All [s] (-> (I64 s) (I64 s)))
@@ -5522,7 +5522,7 @@
"Wherever a binding appears, the bound codes will be spliced in there."
(test: "Code operations & structures"
(with-expansions
- [<tests> (do-template [<expr> <text> <pattern>]
+ [<tests> (template [<expr> <text> <pattern>]
[(compare <pattern> <expr>)
(compare <text> (:: Code/encode encode <expr>))
(compare #1 (:: equivalence = <expr> <expr>))]
@@ -5748,7 +5748,7 @@
_
(fail (..wrong-syntax-error ["lux" "name-of"]))))
-(do-template [<type> <even> <odd> <%> <=> <0> <2>]
+(template [<type> <even> <odd> <%> <=> <0> <2>]
[(def: #export (<even> n)
(-> <type> Bit)
(<=> <0> (<%> <2> n)))
@@ -5961,7 +5961,7 @@
))
(macro: #export (template: tokens)
- {#.doc (doc "Define macros in the style of do-template and ^template."
+ {#.doc (doc "Define macros in the style of template and ^template."
"For simple macros that do not need any fancy features."
(template: (square x)
(i/* x x)))}
@@ -6049,7 +6049,7 @@
_
(fail (..wrong-syntax-error (name-of ..for))))))
-(do-template [<name> <type> <output>]
+(template [<name> <type> <output>]
[(def: (<name> xy)
(All [a b] (-> [a b] <type>))
(let [[x y] xy]
@@ -6200,7 +6200,7 @@
(|> raw (shift param)))
raw)))
-(do-template [<type> </%> </> <%>]
+(template [<type> </%> </> <%>]
[(def: #export (</%> param subject)
(-> <type> <type> [<type> <type>])
[(</> param subject)
@@ -6242,7 +6242,7 @@
(nat@encode column))]
($_ "lux text concat" "[" fields "]")))
-(do-template [<zero> <one>]
+(template [<zero> <one>]
[(def: #export <zero> #0)
(def: #export <one> #1)]