aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-25 12:17:22 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-25 12:37:15 -0700
commit30dba2ad2162af1239d96c8a4ab26709d72de72a (patch)
treeb3a0bfe9656cec9f2b1af3aea4716666867e6811 /src/property.lisp
parentba99d0c4a5dddf352452483d9e31b118069060f8 (diff)
downloadconsfigurator-30dba2ad2162af1239d96c8a4ab26709d72de72a.tar.gz
DEFINE-DOTTED-PROPERTY-MACRO: avoid evaluating default value forms
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/property.lisp b/src/property.lisp
index 3cc9b04..e34b579 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -232,7 +232,15 @@ through unmodified, so supplied-p information is preserved."
(if will-props
(setq rest (lastcar main)
main (nconc (nbutlast main) (list '&rest rest)))
- (nconc (list '&whole whole) (ordinary-ll-without-&aux args)))))
+ (list* '&whole whole
+ ;; Strip default values (so we don't evaluate those
+ ;; forms here and also in the property), and strip
+ ;; supplied-p parameters for good measure as we will
+ ;; not use them.
+ (loop for elt in (ordinary-ll-without-&aux args)
+ if (listp elt)
+ collect (list (car elt) nil)
+ else collect elt)))))
`(defmacro ,(format-symbol (symbol-package name) "~A." name) ,new-args
,@(cond
((and first will-props)
@@ -243,13 +251,11 @@ through unmodified, so supplied-p information is preserved."
:propspec (props eseqprops ,@,rest)))))
(first
`((declare (ignore ,@(cdr (ordinary-ll-variable-names
- (ordinary-ll-without-&aux args)
- :include-supplied-p t))))
+ (ordinary-ll-without-&aux args)))))
(list* ',name ,first (cddr ,whole))))
(t
`((declare (ignore ,@(ordinary-ll-variable-names
- (ordinary-ll-without-&aux args)
- :include-supplied-p t)))
+ (ordinary-ll-without-&aux args))))
(cons ',name (cdr ,whole)))))))))
(defmacro define-property-defining-macro