closer-mop-packages.lisp 7.96 KB
Newer Older
Pascal Costanza's avatar
Pascal Costanza committed
1
2
3
(in-package :cl-user)

(defpackage #:closer-mop
4
  (:use #:common-lisp #+lispworks #:lispworks)
Pascal Costanza's avatar
Pascal Costanza committed
5
6
  (:nicknames #:c2mop)

7
  #+(or allegro clozure lispworks mcl)
8
  (:shadow #:standard-class)
Pascal Costanza's avatar
Pascal Costanza committed
9

10
  #+(or allegro clisp clozure ecl lispworks sbcl)
11
  (:shadow #:defgeneric #:defmethod #:standard-generic-function)
Pascal Costanza's avatar
Pascal Costanza committed
12

13
14
15
16
  #+clozure (:shadow standard-method)

  #+(or cmu mcl) (:shadow #:typep subtypep)

17
  #+lispworks5.1
18
19
20
  (:import-from #:system #:with-hash-table-locked)
  #+lispworks6
  (:import-from #:hcl #:with-hash-table-locked)
21

22
23
  #-(or clisp scl)
  (:import-from
Pascal Costanza's avatar
Pascal Costanza committed
24
   #+abcl      #:ext
25
26
27
   #+allegro   #:excl
   #+clozure   #:ccl
   #+cmu       #:pcl
28
   #+ecl       #:clos
29
30
31
32
33
34
35
   #+lispworks #:clos
   #+mcl       #:ccl
   #+sbcl      #:sb-pcl

   #:classp)

  (:import-from
Pascal Costanza's avatar
Pascal Costanza committed
36
   #+abcl      #:mop
37
38
39
40
   #+allegro   #:mop
   #+clisp     #:clos
   #+clozure   #:ccl
   #+cmu       #:clos-mop
41
   #+ecl       #:clos
42
43
44
45
   #+lispworks #:clos
   #+mcl       #:ccl
   #+sbcl      #:sb-mop
   #+scl       #:clos
46

Pascal Costanza's avatar
Pascal Costanza committed
47
48
49
50
   #:direct-slot-definition
   #:effective-slot-definition
   #-lispworks #:eql-specializer
   #:forward-referenced-class
51
   #-lispworks #:funcallable-standard-class
52
   #-lispworks4 #:funcallable-standard-object
Pascal Costanza's avatar
Pascal Costanza committed
53
54
   #:metaobject
   #:slot-definition
55
   #-(or lispworks4 lispworks5 scl) #:specializer
Pascal Costanza's avatar
Pascal Costanza committed
56
57
58
59
60
61
62
63
   #:standard-accessor-method
   #:standard-direct-slot-definition
   #:standard-effective-slot-definition
   #:standard-reader-method
   #:standard-slot-definition
   #:standard-writer-method

   #-lispworks4.3 #:accessor-method-slot-definition
64
65
   #-scl #:add-dependent
   #-scl #:add-direct-method
Pascal Costanza's avatar
Pascal Costanza committed
66
   #:add-direct-subclass
67
68
   #-scl #:class-default-initargs
   #-scl #:class-direct-default-initargs
Pascal Costanza's avatar
Pascal Costanza committed
69
70
71
72
73
74
75
   #:class-direct-slots
   #:class-direct-subclasses
   #:class-direct-superclasses
   #:class-finalized-p
   #:class-precedence-list
   #:class-prototype
   #:class-slots
76
   #-(or clozure lispworks mcl) #:compute-applicable-methods-using-classes
Pascal Costanza's avatar
Pascal Costanza committed
77
   #:compute-class-precedence-list
78
   #-(or lispworks4 lispworks5) #:compute-default-initargs
79
80
   #-clozure #:compute-discriminating-function
   #-(or clozure scl) #:compute-effective-method
Pascal Costanza's avatar
Pascal Costanza committed
81
82
83
84
85
86
87
88
   #:compute-effective-slot-definition
   #:compute-slots
   #:direct-slot-definition-class
   #:effective-slot-definition-class
   #:ensure-class
   #:ensure-class-using-class
   #:ensure-generic-function-using-class
   #-lispworks #:eql-specializer-object
89
90
   #:extract-lambda-list
   #:extract-specializer-names
Pascal Costanza's avatar
Pascal Costanza committed
91
   #:finalize-inheritance
92
   #-lispworks #:find-method-combination
93
94
   #-(or lispworks scl) #:funcallable-standard-instance-access
   #-allegro #:generic-function-argument-precedence-order
95
   #:generic-function-declarations
Pascal Costanza's avatar
Pascal Costanza committed
96
   #:generic-function-lambda-list
97
   #:generic-function-method-class
Pascal Costanza's avatar
Pascal Costanza committed
98
99
100
101
   #:generic-function-method-combination
   #:generic-function-methods
   #:generic-function-name
   #-lispworks #:intern-eql-specializer
102
103
   #-(or allegro clisp clozure lispworks mcl scl) #:make-method-lambda
   #-scl #:map-dependents
104
   #-clozure #:method-function
Pascal Costanza's avatar
Pascal Costanza committed
105
106
107
108
   #:method-generic-function
   #:method-lambda-list
   #:method-specializers
   #-lispworks4.3 #:reader-method-class
109
110
   #-scl #:remove-dependent
   #-scl #:remove-direct-method
Pascal Costanza's avatar
Pascal Costanza committed
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
   #:remove-direct-subclass
   #:set-funcallable-instance-function
   #:slot-boundp-using-class
   #:slot-definition-allocation
   #:slot-definition-initargs
   #:slot-definition-initform
   #:slot-definition-initfunction
   #:slot-definition-location
   #:slot-definition-name
   #:slot-definition-readers
   #:slot-definition-writers
   #:slot-definition-type
   #:slot-makunbound-using-class
   #:slot-value-using-class
   #-lispworks #:specializer-direct-generic-functions
   #:specializer-direct-methods
   #-lispworks #:standard-instance-access
128
129
   #-scl #:update-dependent
   #:validate-superclass
Pascal Costanza's avatar
Pascal Costanza committed
130
131
132
   #-lispworks4.3 #:writer-method-class)

  (:export
133
134
   #:built-in-class
   #:class
Pascal Costanza's avatar
Pascal Costanza committed
135
136
137
   #:direct-slot-definition
   #:effective-slot-definition
   #:eql-specializer
138
   #+lispworks #:eql-specializer*
Pascal Costanza's avatar
Pascal Costanza committed
139
140
141
   #:forward-referenced-class
   #:funcallable-standard-class
   #:funcallable-standard-object
142
   #:generic-function
Pascal Costanza's avatar
Pascal Costanza committed
143
   #:metaobject
144
145
   #:method
   #:method-combination
Pascal Costanza's avatar
Pascal Costanza committed
146
   #:slot-definition
147
   #:specializer
Pascal Costanza's avatar
Pascal Costanza committed
148
   #:standard-accessor-method
149
150
   #:standard-class
   #:standard-generic-function
Pascal Costanza's avatar
Pascal Costanza committed
151
152
   #:standard-direct-slot-definition
   #:standard-effective-slot-definition
153
154
   #:standard-method
   #:standard-object
Pascal Costanza's avatar
Pascal Costanza committed
155
156
157
158
   #:standard-reader-method
   #:standard-slot-definition
   #:standard-writer-method

159
160
161
162
163
   #:defclass
   #:defgeneric
   #:define-method-combination
   #:defmethod

164
   #:classp
165
   #:ensure-finalized
Pascal Costanza's avatar
Pascal Costanza committed
166
167
   #:ensure-method
   #:fix-slot-initargs
168
   #:required-args
169
   #:subclassp
Pascal Costanza's avatar
Pascal Costanza committed
170

171
   #:accessor-method-slot-definition
Pascal Costanza's avatar
Pascal Costanza committed
172
173
174
175
176
177
178
179
180
181
182
183
   #:add-dependent
   #:add-direct-method
   #:add-direct-subclass
   #:class-default-initargs
   #:class-direct-default-initargs
   #:class-direct-slots
   #:class-direct-subclasses
   #:class-direct-superclasses
   #:class-finalized-p
   #:class-precedence-list
   #:class-prototype
   #:class-slots
184
   #:compute-applicable-methods-using-classes
Pascal Costanza's avatar
Pascal Costanza committed
185
   #:compute-class-precedence-list
186
   #:compute-default-initargs
Pascal Costanza's avatar
Pascal Costanza committed
187
188
   #:compute-discriminating-function
   #:compute-effective-method
189
   #:compute-effective-method-function
Pascal Costanza's avatar
Pascal Costanza committed
190
191
192
193
194
195
   #:compute-effective-slot-definition
   #:compute-slots
   #:direct-slot-definition-class
   #:effective-slot-definition-class
   #:ensure-class
   #:ensure-class-using-class
196
   #:ensure-generic-function
Pascal Costanza's avatar
Pascal Costanza committed
197
198
199
200
201
202
   #:ensure-generic-function-using-class
   #:eql-specializer-object
   #:extract-lambda-list
   #:extract-specializer-names
   #:finalize-inheritance
   #:find-method-combination
203
   #:funcallable-standard-instance-access
Pascal Costanza's avatar
Pascal Costanza committed
204
205
206
207
208
209
210
211
   #:generic-function-argument-precedence-order
   #:generic-function-declarations
   #:generic-function-lambda-list
   #:generic-function-method-class
   #:generic-function-method-combination
   #:generic-function-methods
   #:generic-function-name
   #:intern-eql-specializer
212
   #+lispworks #:intern-eql-specializer*
Pascal Costanza's avatar
Pascal Costanza committed
213
214
215
216
217
218
   #:make-method-lambda
   #:map-dependents
   #:method-function
   #:method-generic-function
   #:method-lambda-list
   #:method-specializers
219
   #:reader-method-class
Pascal Costanza's avatar
Pascal Costanza committed
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
   #:remove-dependent
   #:remove-direct-method
   #:remove-direct-subclass
   #:set-funcallable-instance-function
   #:slot-boundp-using-class
   #:slot-definition-allocation
   #:slot-definition-initargs
   #:slot-definition-initform
   #:slot-definition-initfunction
   #:slot-definition-location
   #:slot-definition-name
   #:slot-definition-readers
   #:slot-definition-writers
   #:slot-definition-type
   #:slot-makunbound-using-class
   #:slot-value-using-class
   #:specializer-direct-generic-functions
   #:specializer-direct-methods
238
   #:standard-instance-access
239
240
   #:subtypep
   #:typep
Pascal Costanza's avatar
Pascal Costanza committed
241
242
   #:update-dependent
   #:validate-superclass
243
   #:writer-method-class
244
245

   #:warn-on-defmethod-without-generic-function))
246

247
248
(in-package :closer-mop)

249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
(macrolet ((define-closer-common-lisp-package ()
             (loop with symbols = (nunion (loop for sym being the external-symbols of :common-lisp
                                                if (find-symbol (symbol-name sym) :c2mop)
                                                collect it
                                                else collect sym)
                                          (loop for sym being the external-symbols of :c2mop
                                                collect sym))
                   with map = '()
                   for symbol in symbols do
                   (push (symbol-name symbol)
                         (getf map (symbol-package symbol)))
                   finally (return 
                            `(defpackage #:closer-common-lisp
                               (:nicknames #:c2cl)
                               (:use)
                               ,@(loop for (package symbols) on map by #'cddr
                                       collect `(:import-from ,(package-name package) ,@symbols))
                               (:export ,@(mapcar #'symbol-name symbols)))))))
  (define-closer-common-lisp-package))

(defpackage #:closer-common-lisp-user
  (:nicknames #:c2cl-user)
  (:use #:closer-common-lisp))