[Openmcl-devel] How to get names of slots of a structure?

Kevin Rosenberg kevin at rosenberg.net
Sun Oct 20 19:53:15 PDT 2002


Gary Byers wrote:
> ;;; I -think- this is right ...
> ;;; You may or may not be interested in the shared (class) slot names.
> ;;; This should work the same way in both commercial MCL and OpenMCL.
> 
> #+mcl
> (defun class-slot-names (class-name)
>   (let* ((class (find-class class-name nil)))
>     (when (typep class 'standard-class)
>       (append (map 'list #'car (ccl::%class-instance-slotds class))
>               (map 'list #'car (ccl::%class-shared-slotds class))))))

That works perfectly. Thanks so much!

-- 
       Kevin Rosenberg        |  .''`.  ** Debian GNU/Linux **
  http://b9.com/debian.html   | : :' :      The  universal
  GPG signed and encrypted    | `. `'      Operating System
     messages accepted.       |   `-    http://www.debian.org/

_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list