X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fkmr-mop.lisp;h=530bee4acd3446a87d3a9eb355f38b35e27ddb51;hp=6949c12acac33230a884ef7f57ec5b89cfde07a5;hb=5be31565b7d87b90f0e79a9e61af84ad05e12920;hpb=a4449b6f1b9fb2471da255fc506bcad6f8feb220 diff --git a/sql/kmr-mop.lisp b/sql/kmr-mop.lisp index 6949c12..530bee4 100644 --- a/sql/kmr-mop.lisp +++ b/sql/kmr-mop.lisp @@ -7,15 +7,15 @@ ;;;; 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-sys) #+lispworks @@ -46,3 +46,27 @@ (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 (class-slots class) + #-mop-slot-order-reversed (reverse (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) +