X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=equal.lisp;h=c621fd44bdde39515909ca726f00620fd105a697;hb=6007424292e8d78977bc90bcc29a20d4451cfa41;hp=8049ed1045f5ccd21cdc1c7aa74e2a0a5ddcaeee;hpb=aab275e8e82b4a4a4af4749d79ca49d2dd596c1c;p=kmrcl.git diff --git a/equal.lisp b/equal.lisp index 8049ed1..c621fd4 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: equal.lisp,v 1.10 2003/03/25 05:27:55 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -87,19 +87,28 @@ (return-from test nil))) (return-from test t))) +#+sbcl +(eval-when (:compile-toplevel :load-toplevel :execute) + (if (find-package 'sb-mop) + (pushnew :sb-mop cl:*features*) + (pushnew :sb-acl cl:*features*))) + (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))) + #+sbcl-mop (mapcar #'sb-mop::slot-definition-name + (sb-mop:class-slots (find-class c-name))) + #+sbcl-pcl (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))) + (let* ((class (find-class c-name nil))) (when (typep class 'standard-class) - (map 'list #'car (ccl::%class-instance-slotds class)))) + (nconc (mapcar #'car (ccl:class-instance-slots class)) + (mapcar #'car (ccl:class-class-slots class))))) #-(or allegro lispworks cmu mcl sbcl scl) (error "class-slot-names is not defined on this platform") ) @@ -109,8 +118,10 @@ #+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))) + #+sbcl-mop (mapcar #'sb-mop::slot-definition-name + (sb-mop:class-slots (find-class s-name))) + #+sbcl-pcl (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))) #+scl (mapcar #'kernel:dsd-name @@ -125,6 +136,11 @@ ) +(eval-when (:compile-toplevel :load-toplevel :execute) + (if (find-package 'sb-mop) + (setq cl:*features* (delete :sb-mop cl:*features*)) + (setq cl:*features* (delete :sb-acl cl:*features*)))) + (defun function-to-string (obj) "Returns the lambda code for a function. Relies on Allegro implementation-dependent features."