From: Mark Wooding Date: Thu, 1 Jun 2006 15:51:09 +0000 (+0100) Subject: Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/lisp/commitdiff_plain/93c540af1697a73fe04cba69ef91c3e4ace3003c?hp=a08142379f65d760e71653974e669320a6867929 Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp * 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/public-git/lisp: sys-base: Portability fixes again. Porting stuff. --- diff --git a/collect.lisp b/collect.lisp index 219f351..359780c 100644 --- a/collect.lisp +++ b/collect.lisp @@ -71,4 +71,19 @@ (defmacro collect-tail (x &optional (name *collecting-anon-list-name*)) (setf (cdar ,name) ,x) (setf (car ,name) nil))) +(defmacro collect-append (list &optional (name *collecting-anon-list-name*)) + "Append LIST to the tail of `collecting' list NAME. This obviously + involves copying LIST." + (with-gensyms item + `(dolist (,item ,list) + (collect ,item ,name)))) + +(defmacro collect-nconc (list &optional (name *collecting-anon-list-name*)) + "Attach LIST to the tail of `collecting' list NAME. This will involve + destroying LIST if anything else gets collected afterwards." + (let*/gensyms list + `(when ,list + (setf (cdar ,name) ,list) + (setf (car ,name) (last ,list))))) + ;;;----- That's all, folks --------------------------------------------------