r4684: Auto commit for Debian build
[kmrcl.git] / mop.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          mop.lisp
6 ;;;; Purpose:       Imports standard MOP symbols into KMRCL
7 ;;;; Programmer:    Kevin M. Rosenberg
8 ;;;; Date Started:  Apr 2003
9 ;;;;
10 ;;;; $Id: mop.lisp,v 1.8 2003/04/29 05:54:24 kevin Exp $
11 ;;;;
12 ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
13 ;;;;
14 ;;;; KMRCL users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the Lisp Lesser GNU Public License
16 ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
17 ;;;; *************************************************************************
18
19 ;;; This file imports MOP symbols into KMR-MOP packages and then
20 ;;; re-exports them to hide differences in MOP implementations.
21
22 (in-package #:cl-user)
23
24 #+sbcl
25 (eval-when (:compile-toplevel :load-toplevel :execute)
26   (if (find-package 'sb-mop)
27       (pushnew :kmr-sbcl-mop cl:*features*)
28       (pushnew :kmr-sbcl-pcl cl:*features*)))
29
30 #+cmu
31 (eval-when (:compile-toplevel :load-toplevel :execute)
32   (if (find-package 'mop)
33       (pushnew :kmr-cmucl-mop cl:*features*)
34       (pushnew :kmr-cmucl-pcl cl:*features*)))
35
36 (defpackage #:kmr-mop
37   (:use
38    #:cl
39    #:kmrcl
40    #+kmr-sbcl-mop #:sb-mop
41    #+kmr-cmucl-mop #:mop
42    #+allegro #:mop
43    #+lispworks #:clos
44    #+scl #:clos))
45
46 (in-package #:kmr-mop)
47
48 (eval-when (:compile-toplevel :load-toplevel :execute)
49   (shadowing-import
50    #+allegro
51    '(class-of class-name class-slots find-class mop::standard-class
52      mop::slot-definition-name mop:finalize-inheritance
53      mop::standard-direct-slot-definition mop::standard-effective-slot-definition
54      mop::validate-superclass mop:direct-slot-definition-class
55      mop:compute-effective-slot-definition
56      excl::compute-effective-slot-definition-initargs
57      mop::slot-value-using-class
58      mop:class-prototype mop:generic-function-method-class mop:intern-eql-specializer
59      mop:make-method-lambda mop:generic-function-lambda-list
60      mop::compute-slots
61      ;; note: make-method-lambda is not fbound
62      )
63    #+lispworks
64    '(class-of class-name class-slots find-class
65      clos::standard-class
66      clos:slot-definition-name clos::finalize-inheritance
67      clos::standard-direct-slot-definition
68      clos::standard-effective-slot-definition clos::validate-superclass
69      clos::direct-slot-definition-class clos::compute-effective-slot-definition
70      clos::compute-effective-slot-definition-initargs
71      clos::slot-value-using-class
72      clos:class-prototype clos:generic-function-method-class clos:intern-eql-specializer
73      clos:make-method-lambda clos:generic-function-lambda-list
74      clos::compute-slots)
75    #+sbcl
76    '(sb-pcl:class-of sb-pcl:class-name sb-pcl:class-slots sb-pcl:find-class
77      sb-pcl::standard-class
78      sb-pcl:slot-definition-name sb-pcl::finalize-inheritance
79      sb-pcl::standard-direct-slot-definition
80      sb-pcl::standard-effective-slot-definition sb-pcl::validate-superclass
81      sb-pcl::direct-slot-definition-class sb-pcl::compute-effective-slot-definition
82      sb-pcl::compute-effective-slot-definition-initargs
83      sb-pcl::slot-value-using-class
84      sb-pcl:class-prototype sb-pcl:generic-function-method-class sb-pcl:intern-eql-specializer
85      sb-pcl:make-method-lambda sb-pcl:generic-function-lambda-list
86      sb-pcl::compute-slots)
87    #+cmu
88    '(pcl:class-of  pcl:class-name pcl:class-slots pcl:find-class pcl::standard-class
89      pcl::slot-definition-name pcl:finalize-inheritance
90      pcl::standard-direct-slot-definition pcl::standard-effective-slot-definition
91      pcl::validate-superclass pcl:direct-slot-definition-class
92      pcl:compute-effective-slot-definition
93      pcl::compute-effective-slot-definition-initargs
94      pcl::slot-value-using-class
95      pcl:class-prototype pcl:generic-function-method-class pcl:intern-eql-specializer
96      pcl:make-method-lambda pcl:generic-function-lambda-list
97      pcl::compute-slots)
98    #+scl
99    '(class-of class-name class-slots find-class clos::standard-class
100      clos::slot-definition-name clos:finalize-inheritance
101      clos::standard-direct-slot-definition clos::standard-effective-slot-definition
102      clos::validate-superclass clos:direct-slot-definition-class
103      clos:compute-effective-slot-definition
104      clos::compute-effective-slot-definition-initargs
105      clos::slot-value-using-class
106      clos:class-prototype clos:generic-function-method-class clos:intern-eql-specializer
107      clos:make-method-lambda clos:generic-function-lambda-list
108      clos::compute-slots
109      ;; note: make-method-lambda is not fbound
110      ))
111   
112   (export '(class-of class-name class-slots find-class
113             standard-class
114             slot-definition-name finalize-inheritance
115             standard-direct-slot-definition
116             standard-effective-slot-definition validate-superclass
117             direct-slot-definition-class compute-effective-slot-definition
118             compute-effective-slot-definition-initargs
119             slot-value-using-class
120             class-prototype generic-function-method-class intern-eql-specializer
121             make-method-lambda generic-function-lambda-list
122             compute-slots))
123   
124   #+sbcl
125   (if (find-package 'sb-mop)
126       (setq cl:*features* (delete :kmr-sbcl-mop cl:*features*))
127       (setq cl:*features* (delete :kmr-sbcl-pcl cl:*features*)))
128   
129   #+cmu
130   (if (find-package 'mop)
131       (setq cl:*features* (delete :kmr-cmucl-mop cl:*features*))
132       (setq cl:*features* (delete :kmr-cmucl-pcl cl:*features*)))
133   
134   (when (>= (length (generic-function-lambda-list
135                      (ensure-generic-function
136                       'compute-effective-slot-definition)))
137             3)
138     (pushnew :kmr-normal-cesd cl:*features*))
139   
140   (when (>= (length (generic-function-lambda-list
141                      (ensure-generic-function
142                       'direct-slot-definition-class)))
143             3)
144     (pushnew :kmr-normal-dsdc cl:*features*))
145
146   )  ;; eval-when