From 34688ece623cfac6238cdbb5ca220de470bc75ce Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 12 Jul 2021 16:44:37 -0600 Subject: [PATCH] Require extraHandling for variadic zip --- kiss/src/kiss/Macros.hx | 2 +- projects/asciilib2/src/asciilib/Surface.kiss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kiss/src/kiss/Macros.hx b/kiss/src/kiss/Macros.hx index cb4228e3..d4981b94 100644 --- a/kiss/src/kiss/Macros.hx +++ b/kiss/src/kiss/Macros.hx @@ -171,7 +171,7 @@ class Macros { }; macros["zip"] = (wholeExp:ReaderExp, exps:kiss.List, k) -> { - wholeExp.checkNumArgs(2, null, '(zip [listA] [listB] [moreLists...])'); + wholeExp.checkNumArgs(3, null, '(zip [listA] [listB] [moreLists...] [extraHandling])'); var b = wholeExp.expBuilder(); return b.callSymbol("Prelude.zip", [b.list(exps.slice(0, -1)), exps[-1]]); }; diff --git a/projects/asciilib2/src/asciilib/Surface.kiss b/projects/asciilib2/src/asciilib/Surface.kiss index 51bf22ba..b2dafddc 100644 --- a/projects/asciilib2/src/asciilib/Surface.kiss +++ b/projects/asciilib2/src/asciilib/Surface.kiss @@ -35,9 +35,9 @@ // TODO rectangle type // TODO optional source rectangle argument (defmethod blitSurface [:Surface surface x y] - (doFor [srcX destX] (zip (collect (range 0 surface.width)) (collect (range x (+ x surface.width)))) + (doFor [srcX destX] (zip (collect (range 0 surface.width)) (collect (range x (+ x surface.width))) Drop) (when (< -1 destX width) - (doFor [srcY destY] (zip (collect (range 0 surface.height)) (collect (range y (+ y surface.height)))) + (doFor [srcY destY] (zip (collect (range 0 surface.height)) (collect (range y (+ y surface.height))) Drop) (when (< -1 destY height) (when (surface.isCellOpaque srcX srcY) (setBackgroundColor destX destY (surface.getBackgroundColor srcX srcY))