# HG changeset patch # User Steve Losh # Date 1470663567 0 # Node ID e5c5cf8143a2acf144d3d208d1d91174c03dc84a # Parent 5dda89e955a330718cf3177bbbbfd9898e2ba2b8 Let `zapf` take many pairs diff -r 5dda89e955a3 -r e5c5cf8143a2 losh.lisp --- a/losh.lisp Sun Aug 07 13:54:42 2016 +0000 +++ b/losh.lisp Mon Aug 08 13:39:27 2016 +0000 @@ -210,9 +210,11 @@ "Multiply `place` by `n` in-place." `(zap% ,place #'* % ,n)) -(defmacro zapf (place function) - "Update `place` with the result of calling `function` on it." - `(zap% ,place ,function %)) +(defmacro zapf (&rest args) + "Zap each place with each function." + `(progn + ,@(iterate (for (place function) :on args :by #'cddr) + (collect `(zap% ,place ,function %))))) ;;;; Hash Tables