chiark / gitweb /
collect: Declare results as having type list.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Apr 2006 14:37:53 +0000 (15:37 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 30 Apr 2006 14:37:53 +0000 (15:37 +0100)
It seems that CMU CL can't work this out on its own.  I suppose that's
not completely surprising.

collect.lisp

index 946ba916257b253cb413c300eac350c25c1a7075..219f3514f95fc0699bc941a1aeeb8729f80f6f22 100644 (file)
@@ -45,7 +45,7 @@ (defmacro collecting (vars &body body)
        ((atom vars) (setf vars (list vars))))
   `(let ,(mapcar (lambda (v) `(,v (make-collector))) vars)
      ,@body
-     (values ,@(mapcar (lambda (v) `(cdr ,v)) vars))))
+     (values ,@(mapcar (lambda (v) `(the list (cdr ,v))) vars))))
 
 (defmacro with-collection (vars collection &body body)
   "Collect items into lists VARS according to the form COLLECTION; then