diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/macro/template.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/library/lux/macro/template.lux b/stdlib/source/library/lux/macro/template.lux index c489703fc..36edd6a1e 100644 --- a/stdlib/source/library/lux/macro/template.lux +++ b/stdlib/source/library/lux/macro/template.lux @@ -26,10 +26,10 @@ ["." code] ["." local]]) -(syntax: #export (splice {parts (<code>.tuple (<>.some <code>.any))}) +(syntax: #export (spliced {parts (<code>.tuple (<>.some <code>.any))}) (wrap parts)) -(syntax: #export (count {parts (<code>.tuple (<>.some <code>.any))}) +(syntax: #export (amount {parts (<code>.tuple (<>.some <code>.any))}) (wrap (list (code.nat (list.size parts))))) (syntax: #export (with_locals {locals (<code>.tuple (<>.some <code>.local_identifier))} @@ -100,7 +100,7 @@ (type: Environment (Dictionary Text Code)) -(def: (apply env template) +(def: (applied env template) (-> Environment Code Code) (case template [_ (#.Identifier "" name)] @@ -113,15 +113,15 @@ (^template [<tag>] [[meta (<tag> elems)] - [meta (<tag> (list\map (apply env) elems))]]) + [meta (<tag> (list\map (applied env) elems))]]) ([#.Tuple] [#.Form]) [meta (#.Record members)] [meta (#.Record (list\map (: (-> [Code Code] [Code Code]) (function (_ [key value]) - [(apply env key) - (apply env value)])) + [(applied env key) + (applied env value)])) members))] _ @@ -141,14 +141,14 @@ (-> Local Macro) ("lux macro" (function (_ inputs compiler) - (.let [parameters_count (list.size parameters) - inputs_count (list.size inputs)] - (if (nat.= parameters_count inputs_count) + (.let [parameters_amount (list.size parameters) + inputs_amount (list.size inputs)] + (if (nat.= parameters_amount inputs_amount) (.let [environment (: Environment (|> (list.zip/2 parameters inputs) - (dictionary.from_list text.hash)))] - (#.Right [compiler (list\map (..apply environment) template)])) - (exception.throw ..irregular_arguments [parameters_count inputs_count])))))) + (dictionary.of_list text.hash)))] + (#.Right [compiler (list\map (..applied environment) template)])) + (exception.throw ..irregular_arguments [parameters_amount inputs_amount])))))) (def: local (Parser Local) |