# HG changeset patch # User Steve Losh # Date 1576108374 18000 # Node ID 164b3e41c13b649fd14c488cb637833ee59cddb3 # Parent f3327aa93670be7e50f2c7f1ccb0374de029b64d# Parent a996dd9ad3ebe7f944373696db137a9e9ea1e419 Merge. diff -r a996dd9ad3eb -r 164b3e41c13b src/iterate.lisp --- a/src/iterate.lisp Wed Dec 11 18:51:49 2019 -0500 +++ b/src/iterate.lisp Wed Dec 11 18:52:54 2019 -0500 @@ -855,9 +855,9 @@ ,@(when result-type `(:result-type ,result-type)))))))) (defmacro-clause (FINDING-FIRST expr SUCH-THAT test &optional INTO var) - "Collect the first `expr`s for which `test` is true. + "Collect the first `expr` for which `test` is true. - Unlike vanilla `finding`, does not block further iteration. + Unlike vanilla `finding`, it does not block further iteration. If `test` is a sharp-quoted function, then it is called on `expr` instead of being evaluated and compared itself. @@ -888,7 +888,7 @@ `(finally (return (values ,@values)))) (defmacro-driver (FOR var-or-vars MATCHING regex AGAINST string &optional OVERLAP overlap? START start END end) - "Iterate over the matches of `regex` in `string`, binding `vars`. + "Iterate over the matches of `regex` in `string`, binding `var-or-vars`. `regex` must be a suitable argument for passing to `ppcre:create-scanner`. Note that `ppcre:create-scanner` accepts already-created scanners and returns diff -r a996dd9ad3eb -r 164b3e41c13b src/queues.lisp --- a/src/queues.lisp Wed Dec 11 18:51:49 2019 -0500 +++ b/src/queues.lisp Wed Dec 11 18:52:54 2019 -0500 @@ -10,7 +10,7 @@ (declaim - (ftype (function () + (ftype (function (&key (:initial-contents list)) (values queue &optional)) make-queue) (ftype (function (queue) @@ -27,9 +27,12 @@ queue-append)) -(defun-inlineable make-queue () +(defun-inlineable make-queue (&key initial-contents) "Allocate and return a fresh queue." - (make-queue%)) + (let ((queue (make-queue%))) + (when initial-contents + (queue-append queue initial-contents)) + queue)) (defun-inlineable queue-empty-p (queue) "Return whether `queue` is empty."