From 118895081d97279a796cc704e6c23bf92ed79e5e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 30 Mar 2019 21:45:45 -0400 Subject: Re-named "do-template" to "template". --- stdlib/source/lux.lux | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'stdlib/source/lux.lux') 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 [ ]" ..new-line + "(template [ ]" ..new-line " " "[(def: #export (-> Int Int) (i/+ ))]" __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 [ +(template [ <<-doc> <<=-doc> <>-doc> <>=-doc>] [(def:''' #export ( test subject) @@ -2412,7 +2412,7 @@ ("lux coerce" Int param))] ("lux i64 -" subject flat))) -(do-template [ ] +(template [ ] [(def:''' #export ( param subject) (list [(tag$ ["lux" "doc"]) (text$ )]) @@ -2426,7 +2426,7 @@ [ Rev r/- "lux i64 -" "Rev(olution) substraction."] ) -(do-template [ ] +(template [ ] [(def:''' #export ( param subject) (list [(tag$ ["lux" "doc"]) (text$ )]) @@ -2525,7 +2525,7 @@ _ ("lux i64 left-shift" (n/- trailing-zeroes 64) 1)} trailing-zeroes))))) -(do-template [ ] +(template [ ] [(def:''' #export ( left right) (list [(tag$ ["lux" "doc"]) (text$ )]) @@ -2876,7 +2876,7 @@ _ #0} xs)) -(do-template [ ] +(template [ ] [(def:''' ( xy) #Nil (All [a b] (-> (& a b) )) @@ -3569,7 +3569,7 @@ (#Some y) (#Some y)))) -(do-template [
] +(template [ ] [(macro: #export ( tokens) {#.doc } (case (list@reverse tokens) @@ -3740,7 +3740,7 @@ _ #None)) -(do-template [ ] +(template [ ] [(def: ( type) (-> Type (List Type)) (case type @@ -4046,7 +4046,7 @@ (fail "Wrong syntax for type:")) )) -(do-template [ ] +(template [ ] [(def: #export ( value) (-> (I64 Any) ) (:coerce 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 [ ] +(template [ ] [(def: #export ( n) (-> ) ( [n]))] @@ -5220,7 +5220,7 @@ (-> Text Text) ($_ text@compose ..double-quote original ..double-quote)) -(do-template [ ] +(template [ ] [(def: #export ( value) {#.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 - [ (do-template [ ] + [ (template [ ] [(compare ) (compare (:: Code/encode encode )) (compare #1 (:: equivalence = ))] @@ -5748,7 +5748,7 @@ _ (fail (..wrong-syntax-error ["lux" "name-of"])))) -(do-template [ <%> <=> <0> <2>] +(template [ <%> <=> <0> <2>] [(def: #export ( n) (-> 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 [ ] +(template [ ] [(def: ( xy) (All [a b] (-> [a b] )) (let [[x y] xy] @@ -6200,7 +6200,7 @@ (|> raw (shift param))) raw))) -(do-template [ <%>] +(template [ <%>] [(def: #export ( param subject) (-> [ ]) [( param subject) @@ -6242,7 +6242,7 @@ (nat@encode column))] ($_ "lux text concat" "[" fields "]"))) -(do-template [ ] +(template [ ] [(def: #export #0) (def: #export #1)] -- cgit v1.2.3