X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fkmr-mop.lisp;h=c628dc2d6c98b9079af6884f440ffc48a6801660;hb=56a0b7f90d30e321ca7e95f15dab3c43bd551e3f;hp=b709f1bea9c0b7ec81b21f4bd6ee462d9e93b881;hpb=b43e20a168dae4ae9d176ebc0fbf18ea6e4517dc;p=clsql.git diff --git a/sql/kmr-mop.lisp b/sql/kmr-mop.lisp index b709f1b..c628dc2 100644 --- a/sql/kmr-mop.lisp +++ b/sql/kmr-mop.lisp @@ -16,7 +16,7 @@ ;;;; This file was extracted from the KMRCL utilities ;;;; ************************************************************************* -(in-package #:clsql) +(in-package #:clsql-sys) #+lispworks (defun intern-eql-specializer (slot) @@ -25,8 +25,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 +37,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)