From 20d6349679462da99c3642f029910f4d1144c039 Mon Sep 17 00:00:00 2001 From: gilch Date: Tue, 11 Aug 2015 19:35:22 -0600 Subject: [PATCH] make xi compatible with Python2 --- hy/contrib/anaphoric.hy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hy/contrib/anaphoric.hy b/hy/contrib/anaphoric.hy index 0584a76..df80e68 100644 --- a/hy/contrib/anaphoric.hy +++ b/hy/contrib/anaphoric.hy @@ -133,12 +133,12 @@ (str i))) [i (range 1 ;; find the maximum xi - (inc (max (genexpr (int (cdr a)) - [a flatbody] - (and (symbol? a) - (.startswith a 'x) - (.isdigit (cdr a)))) - :default 0)))]) + (inc (max (+ (list-comp (int (cdr a)) + [a flatbody] + (and (symbol? a) + (.startswith a 'x) + (.isdigit (cdr a)))) + [0]))))]) ;; generate the &rest paremeter only if 'xi is present in body ~@(if (in 'xi flatbody) '(&rest xi)