From pscott at common-lisp.net Wed Dec 14 21:15:22 2005 From: pscott at common-lisp.net (Peter Scott) Date: Wed, 14 Dec 2005 22:15:22 +0100 (CET) Subject: [cl-utilities-cvs] CVS update: cl-utilities/extremum.lisp Message-ID: <20051214211522.E8A3E8857A@common-lisp.net> Update of /project/cl-utilities/cvsroot/cl-utilities In directory common-lisp.net:/tmp/cvs-serv23548 Modified Files: extremum.lisp Log Message: Big improvement to the documentation. I actually added a manual instead of simply telling people to look at the Cliki pages. Also added a little more argument checking to N-MOST-EXTREME function. Date: Wed Dec 14 22:15:15 2005 Author: pscott Index: cl-utilities/extremum.lisp diff -u cl-utilities/extremum.lisp:1.9 cl-utilities/extremum.lisp:1.10 --- cl-utilities/extremum.lisp:1.9 Wed Nov 30 01:07:15 2005 +++ cl-utilities/extremum.lisp Wed Dec 14 22:15:15 2005 @@ -154,6 +154,7 @@ elements in the relevant part of the sequence, this will return all the elements it can and signal the warning N-MOST-EXTREME-NOT-ENOUGH-ELEMENTS" + (check-type n (integer 0)) (with-check-length (sequence start end) ;; This is faster on vectors than on lists. (let ((sequence (subseq sequence start end))) From pscott at common-lisp.net Wed Dec 14 21:15:24 2005 From: pscott at common-lisp.net (Peter Scott) Date: Wed, 14 Dec 2005 22:15:24 +0100 (CET) Subject: [cl-utilities-cvs] CVS update: cl-utilities/doc/compose.html cl-utilities/doc/copy-array.html cl-utilities/doc/expt-mod.html cl-utilities/doc/index.html cl-utilities/doc/once-only.html cl-utilities/doc/rotate-byte.html cl-utilities/doc/style.css cl-utilities/doc/with-unique-names.html cl-utilities/doc/collecting.html cl-utilities/doc/extremum.html cl-utilities/doc/read-delimited.html cl-utilities/doc/split-sequence.html Message-ID: <20051214211524.4A85588586@common-lisp.net> Update of /project/cl-utilities/cvsroot/cl-utilities/doc In directory common-lisp.net:/tmp/cvs-serv23548/doc Modified Files: collecting.html extremum.html read-delimited.html split-sequence.html Added Files: compose.html copy-array.html expt-mod.html index.html once-only.html rotate-byte.html style.css with-unique-names.html Log Message: Big improvement to the documentation. I actually added a manual instead of simply telling people to look at the Cliki pages. Also added a little more argument checking to N-MOST-EXTREME function. Date: Wed Dec 14 22:15:19 2005 Author: pscott Index: cl-utilities/doc/collecting.html diff -u cl-utilities/doc/collecting.html:1.1 cl-utilities/doc/collecting.html:1.2 --- cl-utilities/doc/collecting.html:1.1 Mon Aug 29 22:18:18 2005 +++ cl-utilities/doc/collecting.html Wed Dec 14 22:15:16 2005 @@ -43,6 +43,19 @@
If the collector names are not all symbols, a type-error will be signalled. +
Examples: + +
+(collecting (dotimes (x 10) (collect x))) => (0 1 2 3 4 5 6 7 8 9) + +(multiple-value-bind (a b) + (with-collectors (x y) + (x 1) + (y 2) + (x 3)) + (append a b)) => (1 2 3) ++
Implementation notes:
Opinions differ on how a collection macro should work. There are @@ -59,5 +72,7 @@ and you can't nest them to get the same effect as multiple collection since it always uses the collect function. If you want to collect into multiple lists, use the with-collect macro.
+ +