From b48ea68a83d01903554c7696c77eedaaf1035680 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 12 Jun 2022 00:38:20 -0400 Subject: De-sigil-ification: suffix : [Part 3] --- stdlib/source/documentation/lux.lux | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'stdlib/source/documentation/lux.lux') diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 59a5159b4..25389845a 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -284,7 +284,7 @@ (documentation: /.template "" ["By specifying a pattern (with holes), and the input data to fill those holes, repeats the pattern as many times as necessary." - (template [ ] + (with_template [ ] [(def: .public (-> Int Int) (+ ))] @@ -433,9 +433,9 @@ [(def: .public symbol (macro (_ tokens) (case tokens - (^template [] - [(pattern (list [_ { [module name]}])) - (in (list (` [(~ (text$ module)) (~ (text$ name))])))]) + (^with_template [] + [(pattern (list [_ { [module name]}])) + (in (list (` [(~ (text$ module)) (~ (text$ name))])))]) ([#Symbol]) _ @@ -516,7 +516,7 @@ (is (-> a a Bit) <)))]) -(.template [] +(.with_template [] [(documentation: "Safe type-casting for I64 values.")] @@ -642,17 +642,17 @@ ... {.#Primitive name params} ... {.#Primitive name (list#each (reduced env) params)} -... (^template [] +... (^with_template [] ... [{ left right} ... { (reduced env left) (reduced env right)}]) ... ([.#Sum] [.#Product]) -... (^template [] +... (^with_template [] ... [{ left right} ... { (reduced env left) (reduced env right)}]) ... ([.#Function] [.#Apply]) -... (^template [] +... (^with_template [] ... [{ old_env def} ... (case old_env ... {.#End} @@ -669,7 +669,7 @@ ... type ... ))]) -(.template [ ] +(.with_template [ ] [(documentation: )] @@ -699,7 +699,7 @@ [(def: test Test (with_expansions - [ (template [ ] + [ (with_template [ ] [(cover [] (compare (at codec encoded )))] @@ -825,11 +825,12 @@ "==" Int]) -(documentation: /.template: - (format "Define macros in the style of template and ^template." +(documentation: /.template + (format "Define macros in the style of with_template." \n "For simple macros that do not need any fancy features.") - [(template: (square x) - (* x x))]) + [(def: square + (template (square x) + (* x x)))]) (documentation: /.these (format "Given a (potentially empty) list of codes, just returns them immediately, without any work done." @@ -999,7 +1000,7 @@ ..as_expected ..undefined ..type_of - ..template: + ..template ..these ..char ..for -- cgit v1.2.3