X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fkmr-mop.lisp;h=172394017be36062da20cee7c6000cf2b2d43d23;hp=3953c8c279db097a67107bcee86a30a848bb8193;hb=d2d49ab13c98bc7a1819a0fd3968268a5567bdc3;hpb=5068697a98c10224f3a3e0a7125ba64cf3d3b4fb diff --git a/sql/kmr-mop.lisp b/sql/kmr-mop.lisp index 3953c8c..1723940 100644 --- a/sql/kmr-mop.lisp +++ b/sql/kmr-mop.lisp @@ -7,8 +7,6 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id$ -;;;; ;;;; This file imports MOP symbols into the CLSQL-MOP package and then ;;;; re-exports into CLSQL-SYS them to hide differences in ;;;; MOP implementations. @@ -25,8 +23,8 @@ (defmacro process-class-option (metaclass slot-name &optional required) #+lispworks `(defmethod clos:process-a-class-option ((class ,metaclass) - (name (eql ,slot-name)) - value) + (name (eql ,slot-name)) + value) (when (and ,required (null value)) (error "metaclass ~A class slot ~A must have a value" (quote ,metaclass) name)) (list name `',value)) @@ -37,18 +35,28 @@ (defmacro process-slot-option (metaclass slot-name) #+lispworks `(defmethod clos:process-a-slot-option ((class ,metaclass) - (option (eql ,slot-name)) - value - already-processed-options - slot) + (option (eql ,slot-name)) + value + already-processed-options + slot) (list* option `',value already-processed-options)) #-lispworks (declare (ignore metaclass slot-name)) ) +(eval-when (:compile-toplevel :load-toplevel :execute) + (defclass %slot-order-test-class () + ((a) + (b))) + (finalize-inheritance (find-class '%slot-order-test-class)) + (let ((slots (class-slots (find-class '%slot-order-test-class)))) + (ecase (slot-definition-name (first slots)) + (a) + (b (pushnew :mop-slot-order-reversed cl:*features*))))) + (defun ordered-class-slots (class) - #+(or cmu sbcl) (class-slots class) - #-(or cmu sbcl) (reverse (class-slots class))) + #+mop-slot-order-reversed (reverse (class-slots class)) + #-mop-slot-order-reversed (class-slots class)) ;; Lispworks has symbol for slot rather than the slot instance (defun %svuc-slot-name (slot)