# HG changeset patch # User Steve Losh # Date 1598889691 14400 # Node ID e389a847e003ab50e35ba6c7101278928414e7ee # Parent 1ca3e16900aa49bc7d7df9b12e9af5d9e3ec3780 Move gathering-vector destructuring into the macro lamda list It's less code and it makes the arglist in slime nicer. diff -r 1ca3e16900aa -r e389a847e003 src/control-flow.lisp --- a/src/control-flow.lisp Mon Jul 27 23:37:04 2020 -0400 +++ b/src/control-flow.lisp Mon Aug 31 12:01:31 2020 -0400 @@ -181,7 +181,7 @@ ,@body) (queue-contents ,result)))) -(defmacro gathering-vector (options &body body) +(defmacro gathering-vector ((&key (size 16) (element-type t)) &body body) "Run `body` to gather some things and return a fresh vector of them. `body` will be executed with the symbol `gather` bound to a function of one @@ -211,16 +211,14 @@ #(1 2 3 a b) " - (destructuring-bind (&key (size 16) (element-type t)) - options - (with-gensyms (result) - `(let ((,result (make-array ,size :adjustable t :fill-pointer 0 - :element-type ,element-type))) - (flet ((gather (item) - (vector-push-extend item ,result) - item)) - ,@body) - ,result)))) + (with-gensyms (result) + `(let ((,result (make-array ,size :adjustable t :fill-pointer 0 + :element-type ,element-type))) + (flet ((gather (item) + (vector-push-extend item ,result) + item)) + ,@body) + ,result))) (defmacro when-let (bindings &body body)