|
268 | 268 |
|
269 | 269 | ;;; DEFSKETCH macro
|
270 | 270 |
|
271 |
| -(defun define-sketch-defclass (name bindings) |
272 |
| - `(defclass ,name (sketch) |
| 271 | +(defun define-sketch-defclass (name superclasses bindings) |
| 272 | + `(defclass ,name (sketch ,@superclasses) |
273 | 273 | (,@(loop for b in bindings
|
274 | 274 | unless (eq 'sketch (binding-prefix b))
|
275 | 275 | collect `(,(binding-name b)
|
|
307 | 307 | collect `(,(binding-accessor b) *sketch*)
|
308 | 308 | collect (binding-name b)))))
|
309 | 309 |
|
| 310 | +(defmacro defsketchx (sketch-name superclasses binding-forms &body body) |
| 311 | + (make-defsketch sketch-name superclasses binding-forms body)) |
| 312 | + |
310 | 313 | (defmacro defsketch (sketch-name binding-forms &body body)
|
| 314 | + (make-defsketch sketch-name (list) binding-forms body)) |
| 315 | + |
| 316 | +(defun make-defsketch (sketch-name superclasses binding-forms body) |
311 | 317 | (let ((bindings (parse-bindings sketch-name binding-forms
|
312 | 318 | (class-bindings (find-class 'sketch)))))
|
313 | 319 | `(progn
|
314 |
| - ,(define-sketch-defclass sketch-name bindings) |
| 320 | + ,(define-sketch-defclass sketch-name superclasses bindings) |
315 | 321 | ,@(define-sketch-channel-observers bindings)
|
316 | 322 | ,(define-sketch-prepare-method sketch-name bindings)
|
317 | 323 | ,(define-sketch-draw-method sketch-name bindings body)
|
|
0 commit comments