From ... From: Erik Naggum Subject: Re: Finding CLOS instances Date: 1998/10/09 Message-ID: <3116943851349974@naggum.no>#1/1 X-Deja-AN: 399424268 References: <6vjprc$55u$1@ash.prod.itd.earthlink.net> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * "Bob Manjoney" | 1) How does one find instances of a particular CLOS class for inspection? | I'm coming from Smalltalk, where the expression: | | someClass allInstances. | | would return a collection of all instances of someClass. Is there anything | comparable in CLOS? nothing in CLOS itself, but I needed this once, and discovered a function (present in Allegro CL 4.3, 4.3.1, and 5.0) that helps me get it: (defun list-all-instances (class) (loop with instances = (excl::get-objects 12) ; standard-instance for index from 1 to (svref instances 0) for instance = (svref instances index) when (typep instance class) collect instance)) (evaluate (print-type-counts) to learn that 12 is standard-instance.) hope this helps. #:Erik