LOOP counts symbols in COMMON-LISP wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
LOOP counts symbols in package COMMON-LISP wrong.
Below is a transcript of example session, following the bug reporting guidelines. I noticed this a couple of years back. I could not reproduce the bug for packages other than COMMON-LISP.
~ $ uname -a
Linux poseidon.akater 4.19.97-
~ $ sbcl --version
SBCL 2.0.1
~ $ rlwrap sbcl
This is SBCL 2.0.1, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* *features*
(:ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
:NON-BASE-
:ELF :GENCGC :IEEE-FLOATING-
:PACKAGE-
:SB-THREAD :SB-UNICODE :SBCL :UNIX)
* (let ((count 0)) (do-symbols (_ (find-package :cl) count) (declare (ignore _)) (incf count)))
978
* (let ((count 0)) (loop for s being each symbol of (find-package :cl) do (incf count)) count)
978
;; for good measure
* (push #P"/home/
(asdf:load-system :series)
* (series:
978
;; and yet
* (loop for s being each symbol of (find-package :cl) count s)
977
http:// www.lispworks. com/documentati on/HyperSpec/ Body/06_ ac.htm
"The count construct counts the number of times that the supplied form returns true."
(loop for x in '(nil) count x) => 0