From dd1ef2c1fecd695d06ac9fab4df1c7f15f74afd5 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Wed, 2 Jan 2008 23:54:37 +0100 Subject: [PATCH] Use WITH-PACKAGE-ITERATOR to obtain external symbols instead of LOOP. Signed-off-by: Stelian Ionescu --- iolib/pkgdcl.lisp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iolib/pkgdcl.lisp b/iolib/pkgdcl.lisp index 2b1dea6..f8a4344 100644 --- a/iolib/pkgdcl.lisp +++ b/iolib/pkgdcl.lisp @@ -28,9 +28,12 @@ (assert (= 1 (length clauses))) (assert (eq (caar clauses) :use)) (flet ((get-symbols (packages) - (loop :for sym :being :the :external-symbols :of packages - :collect sym :into symbols - :finally (return (remove-duplicates symbols :test #'eq))))) + (let (symbols) + (with-package-iterator (iterator packages :external) + (loop (multiple-value-bind (morep symbol) (iterator) + (unless morep (return)) + (push symbol symbols)))) + (remove-duplicates symbols :test #'eq)))) `(defpackage ,name (:use #:common-lisp ,@(cdar clauses)) (:export ,@(get-symbols (cdar clauses))))))) -- 2.11.4.GIT