Skip to content

Commit f57a658

Browse files
Change the syntax so that options go in the bindings form.
1 parent 54c554d commit f57a658

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/sketch.lisp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,22 @@
308308
collect `(,(binding-accessor b) *sketch*)
309309
collect (binding-name b)))))
310310

311-
(defmacro defsketchx (sketch-name superclasses binding-forms &body body)
312-
(make-defsketch sketch-name superclasses binding-forms body))
313-
314311
(defmacro defsketch (sketch-name binding-forms &body body)
315-
(make-defsketch sketch-name (list) binding-forms body))
312+
(multiple-value-bind (options binding-forms)
313+
(extract-options binding-forms)
314+
(make-defsketch sketch-name
315+
(getf options :mixins)
316+
binding-forms
317+
body)))
318+
319+
(defun extract-options (binding-forms)
320+
(let (options)
321+
(loop while (and binding-forms (keywordp (caar binding-forms)))
322+
do (progn
323+
(push (cadar binding-forms) options)
324+
(push (caar binding-forms) options)
325+
(pop binding-forms)))
326+
(values options binding-forms)))
316327

317328
(defun make-defsketch (sketch-name superclasses binding-forms body)
318329
(let ((bindings (parse-bindings sketch-name binding-forms

0 commit comments

Comments
 (0)