X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=equal.lisp;h=da246bd5860849b15ac3a0d84d3b5fb468cbf3d4;hp=8049ed1045f5ccd21cdc1c7aa74e2a0a5ddcaeee;hb=19bee416d52c52d58261faf3d459c45572563149;hpb=aab275e8e82b4a4a4af4749d79ca49d2dd596c1c diff --git a/equal.lisp b/equal.lisp index 8049ed1..da246bd 100644 --- a/equal.lisp +++ b/equal.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: equal.lisp,v 1.2 2002/11/25 07:45:36 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -37,7 +37,7 @@ (complex (and (generalized-equal (realpart obj1) (realpart obj2)) (generalized-equal (imagpart obj1) (imagpart obj2)))) - (standard-xstructure + (structure-object (generalized-equal-fielded-object obj1 obj2)) (standard-object (generalized-equal-fielded-object obj1 obj2)) @@ -89,18 +89,15 @@ (defun class-slot-names (c-name) "Given a CLASS-NAME, returns a list of the slots in the class." - #+(or allegro lispworks scl) - (mapcar #'clos:slot-definition-name - (clos:class-slots (find-class c-name))) - #+sbcl (mapcar #'sb-pcl::slot-definition-name - (sb-pcl:class-slots (sb-pcl:find-class c-name))) - #+cmu (mapcar #'pcl::slot-definition-name - (pcl:class-slots (pcl:find-class c-name))) - #+mcl - (let* ((class (find-class class-name nil))) + #+(or allegro cmu lispworks sbcl scl) + (mapcar #'kmr-mop:slot-definition-name + (kmr-mop:class-slots (kmr-mop:find-class c-name))) + #+(and mcl (not openmcl)) + (let* ((class (find-class c-name nil))) (when (typep class 'standard-class) - (map 'list #'car (ccl::%class-instance-slotds class)))) - #-(or allegro lispworks cmu mcl sbcl scl) + (nconc (mapcar #'car (ccl:class-instance-slots class)) + (mapcar #'car (ccl:class-class-slots class))))) + #-(or allegro lispworks cmu mcl sbcl scl openmcl) (error "class-slot-names is not defined on this platform") ) @@ -109,22 +106,20 @@ #+allegro (class-slot-names s-name) #+lispworks (structure:structure-class-slot-names (find-class s-name)) - #+sbcl (mapcar #'sb-pcl::slot-definition-name - (sb-pcl:class-slots (sb-pcl:find-class s-name))) - #+cmu (mapcar #'pcl::slot-definition-name - (pcl:class-slots (pcl:find-class s-name))) + #+(or sbcl cmu) (mapcar #'kmr-mop:slot-definition-name + (kmr-mop:class-slots (kmr-mop:find-class s-name))) #+scl (mapcar #'kernel:dsd-name (kernel:dd-slots (kernel:layout-info (kernel:class-layout (find-class s-name))))) - #+mcl (let* ((sd (gethash s-name ccl::%defstructs%)) + #+(and mcl (not openmcl)) + (let* ((sd (gethash s-name ccl::%defstructs%)) (slots (if sd (ccl::sd-slots sd)))) (mapcar #'car (if (symbolp (caar slots)) slots (cdr slots)))) #-(or allegro lispworks cmu sbcl scl mcl) (error "structure-slot-names is not defined on this platform") ) - (defun function-to-string (obj) "Returns the lambda code for a function. Relies on Allegro implementation-dependent features."