1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: kmr-mop.lisp
6 ;;;; Purpose: MOP support for multiple-implementions
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Apr 2003
10 ;;;; This file imports MOP symbols into the CLSQL-MOP package and then
11 ;;;; re-exports into CLSQL-SYS them to hide differences in
12 ;;;; MOP implementations.
14 ;;;; This file was extracted from the KMRCL utilities
15 ;;;; *************************************************************************
17 (in-package #:clsql-sys)
20 (defun intern-eql-specializer (slot)
23 (defmacro process-class-option (metaclass slot-name &optional required)
25 `(defmethod clos:process-a-class-option ((class ,metaclass)
26 (name (eql ,slot-name))
28 (when (and ,required (null value))
29 (error "metaclass ~A class slot ~A must have a value" (quote ,metaclass) name))
32 (declare (ignore metaclass slot-name required))
35 (defmacro process-slot-option (metaclass slot-name)
37 `(defmethod clos:process-a-slot-option ((class ,metaclass)
38 (option (eql ,slot-name))
40 already-processed-options
42 (list* option `',value already-processed-options))
44 (declare (ignore metaclass slot-name))
47 (eval-when (:compile-toplevel :load-toplevel :execute)
48 (defclass %slot-order-test-class ()
51 (finalize-inheritance (find-class '%slot-order-test-class))
52 (let ((slots (class-slots (find-class '%slot-order-test-class))))
53 (ecase (slot-definition-name (first slots))
55 (b (pushnew :mop-slot-order-reversed cl:*features*)))))
57 (defun ordered-class-slots (class)
58 #+mop-slot-order-reversed (reverse (class-slots class))
59 #-mop-slot-order-reversed (class-slots class))
61 ;; Lispworks has symbol for slot rather than the slot instance
62 (defun %svuc-slot-name (slot)
64 #-lispworks (slot-definition-name slot))
66 (defun %svuc-slot-object (slot class)
67 (declare (ignorable class))
68 #+lispworks (clos:find-slot-definition slot class)