X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fkmr-mop.lisp;h=c628dc2d6c98b9079af6884f440ffc48a6801660;hp=32cc35db0965b93b9f8d0a00c2d92d643adb0cce;hb=e567409d9fff3f7231c2a0bb69b345e19de2b246;hpb=7f0e4a65d1b425f2fa58fc7cce8296c1a6c52c2f diff --git a/sql/kmr-mop.lisp b/sql/kmr-mop.lisp index 32cc35d..c628dc2 100644 --- a/sql/kmr-mop.lisp +++ b/sql/kmr-mop.lisp @@ -7,16 +7,16 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2003 ;;;; -;;;; $Id: mop.lisp 8573 2004-01-29 23:30:50Z kevin $ +;;;; $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. ;;;; ;;;; This file was extracted from the KMRCL utilities ;;;; ************************************************************************* -;;; This file imports MOP symbols into the USQL-MOP package and then -;;; re-exports into CLSQL-USQL-SYS them to hide differences in -;;; MOP implementations. - -(in-package #:clsql-usql-sys) +(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,12 +37,36 @@ (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) + #+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) + #+lispworks slot + #-lispworks (slot-definition-name slot)) + +(defun %svuc-slot-object (slot class) + (declare (ignorable class)) + #+lispworks (clos:find-slot-definition slot class) + #-lispworks slot) +