From ca238f9c89d3156842b0a3d5fe24a5d69b2eedb0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 6 Apr 2018 08:32:41 -0400 Subject: - Adapted new-luxc's code to latest stdlib changes. --- .../translation/python/procedure/common.jvm.lux | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux index 6205d22a7..badca2d74 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux @@ -52,7 +52,7 @@ (-> Text Bundle Bundle) (|> bundle dict.entries - (list/map (function [[key val]] [(format prefix " " key) val])) + (list/map (function (_ [key val]) [(format prefix " " key) val])) (dict.from-list text.Hash))) (def: (wrong-arity proc expected actual) @@ -62,19 +62,19 @@ " Actual: " (|> actual nat-to-int %i))) (syntax: (arity: [name s.local-symbol] [arity s.nat]) - (with-gensyms [g!proc g!name g!translate g!inputs] + (with-gensyms [g!_ 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)) (-> (-> (..Vector (~ (code.nat arity)) Expression) Expression) (-> Text ..Proc)) - (function [(~ g!name)] - (function [(~ g!translate) (~ g!inputs)] + (function ((~ g!_) (~ g!name)) + (function ((~ g!_) (~ g!translate) (~ g!inputs)) (case (~ g!inputs) (^ (list (~+ g!input+))) (do macro.Monad [(~+ (|> g!input+ - (list/map (function [g!input] + (list/map (function (_ g!input) (list g!input (` ((~ g!translate) (~ g!input)))))) list.concat))] ((~' wrap) ((~ g!proc) [(~+ g!input+)]))) @@ -89,8 +89,8 @@ (def: #export (variadic proc) (-> Variadic (-> Text Proc)) - (function [proc-name] - (function [translate inputsS] + (function (_ proc-name) + (function (_ translate inputsS) (do macro.Monad [inputsI (monad.map @ translate inputsS)] (wrap (proc inputsI)))))) @@ -113,7 +113,9 @@ Unary valueO) -(exception: #export Wrong-Syntax) +(exception: #export (Wrong-Syntax {message Text}) + message) + (def: #export (wrong-syntax procedure args) (-> Text (List ls.Synthesis) Text) (format "Procedure: " procedure "\n" @@ -121,8 +123,8 @@ (def: lux//loop (-> Text Proc) - (function [proc-name] - (function [translate inputsS] + (function (_ proc-name) + (function (_ translate inputsS) (case (s.run inputsS ($_ p.seq s.nat (s.tuple (p.many s.any)) s.any)) (#e.Success [offset initsS+ bodyS]) (loopT.translate-loop translate offset initsS+ bodyS) @@ -133,8 +135,8 @@ (def: lux//recur (-> Text Proc) - (function [proc-name] - (function [translate inputsS] + (function (_ proc-name) + (function (_ translate inputsS) (loopT.translate-recur translate inputsS)))) (def: lux-procs @@ -328,12 +330,12 @@ (def: (apply1 func) (-> Expression (-> Expression Expression)) - (function [value] + (function (_ value) (python.apply (list value) func))) (def: (send0 method) (-> Text (-> Expression Expression)) - (function [object] + (function (_ object) (python.send (list) method object))) (do-template [ ] @@ -489,7 +491,7 @@ (install "log" (unary runtimeT.io//log!)) (install "error" (unary runtimeT.io//throw!)) (install "exit" (unary runtimeT.io//exit!)) - (install "current-time" (nullary (function [_] + (install "current-time" (nullary (function (_ _) (runtimeT.io//current-time! runtimeT.unit))))))) ## [[Atoms]] -- cgit v1.2.3