From f92c4dc2f813b40f14d240491daa665942165e7e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 2 Dec 2017 01:06:34 -0400 Subject: - Adjusted new-luxc to new macro-templating syntax. --- .../luxc/lang/translation/procedure/common.jvm.lux | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/procedure') diff --git a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux index 41d9b91ab..91c5c5f95 100644 --- a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux @@ -47,7 +47,7 @@ (Dict Text Proc)) (syntax: (Vector [size s.nat] elemT) - (wrap (list (` [(~@ (list.repeat size elemT))])))) + (wrap (list (` [(~+ (list.repeat size elemT))])))) (type: #export Nullary (-> (Vector +0 $.Inst) $.Inst)) (type: #export Unary (-> (Vector +1 $.Inst) $.Inst)) @@ -84,23 +84,24 @@ (syntax: (arity: [name s.local-symbol] [arity s.nat]) (with-gensyms [g!proc g!name g!translate g!inputs] (do @ - [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input")))] - (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~ g!proc)) + [g!input+ (monad.seq @ (list.repeat arity (macro.gensym "input"))) + #let [g!input+ (list/map code.symbol g!input+)]] + (wrap (list (` (def: #export ((~ (code.local-symbol name)) (~@ g!proc)) (-> (-> (..Vector (~ (code.nat arity)) $.Inst) $.Inst) (-> Text ..Proc)) - (function [(~ g!name)] - (function [(~ g!translate) (~ g!inputs)] - (case (~ g!inputs) - (^ (list (~@ g!input+))) + (function [(~@ g!name)] + (function [(~@ g!translate) (~@ g!inputs)] + (case (~@ g!inputs) + (^ (list (~+ g!input+))) (do macro.Monad - [(~@ (|> g!input+ + [(~+ (|> g!input+ (list/map (function [g!input] - (list g!input (` ((~ g!translate) (~ g!input)))))) + (list g!input (` ((~@ g!translate) (~ g!input)))))) list.concat))] - ((~' wrap) ((~ g!proc) [(~@ g!input+)]))) + ((~' wrap) ((~@ g!proc) [(~+ g!input+)]))) (~' _) - (macro.fail (wrong-arity (~ g!name) +1 (list.size (~ g!inputs)))))))))))))) + (macro.fail (wrong-arity (~@ g!name) +1 (list.size (~@ g!inputs)))))))))))))) (arity: nullary +0) (arity: unary +1) -- cgit v1.2.3