X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=equal.lisp;h=abc8e399f4f3ce1ebd137da1cf9a936d7f8ce73c;hp=24a60ea89a58204549cb587b5cb897d5fc94b34c;hb=4b512145081c369cb1dbfe579a4dfd5a32476b92;hpb=11ce9a03e7603b105c3a2d9868b6abe4bc4a9b87 diff --git a/equal.lisp b/equal.lisp index 24a60ea..abc8e39 100644 --- a/equal.lisp +++ b/equal.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: equal.lisp,v 1.5 2003/03/25 04:43:17 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -17,10 +17,9 @@ ;;;; ************************************************************************* -(in-package :kmrcl) -(declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3))) +(in-package #:kmrcl) + - (defun generalized-equal (obj1 obj2) (if (not (equal (type-of obj1) (type-of obj2))) (progn @@ -37,7 +36,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,22 +88,17 @@ (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 (if (find-package 'sb-mop) - (mapcar #'sb-mop::slot-definition-name - (sb-mop:class-slots (find-class c-name))) - (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 + #+(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) (nconc (mapcar #'car (ccl:class-instance-slots class)) (mapcar #'car (ccl:class-class-slots class))))) - #-(or allegro lispworks cmu mcl sbcl scl) + #-(or allegro lispworks cmu sbcl scl (and mcl (not openmcl))) + (declare (ignore c-name)) + #-(or allegro lispworks cmu sbcl scl (and mcl (not openmcl))) (error "class-slot-names is not defined on this platform") ) @@ -113,25 +107,22 @@ #+allegro (class-slot-names s-name) #+lispworks (structure:structure-class-slot-names (find-class s-name)) - #+sbcl (if (find-package 'sb-mop) - (mapcar #'sb-mop::slot-definition-name - (sb-mop:class-slots (find-class s-name))) - (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) + #-(or allegro lispworks cmu sbcl scl (and mcl (not openmcl))) + (declare (ignore s-name)) + #-(or allegro lispworks cmu sbcl scl (and mcl (not openmcl))) (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."