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