From c2f2b29a532869f83128ee16635016a7bf474536 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 6 Jun 2021 10:40:56 -0700 Subject: DEFPROPLIST/SPEC: don't always warn about programmatic application Signed-off-by: Sean Whitton --- src/property.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/property.lisp') diff --git a/src/property.lisp b/src/property.lisp index e9d5b4f..6b8dbb1 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -268,7 +268,8 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV." (with-gensyms (name body declarations) `(defmacro ,mname (,name ,typev ,lambdav &body ,body) ,@(and mdocstring `(,mdocstring)) - (let ((,slotsv (list :type ,typev :lambda `',,lambdav))) + (let ((programmatic-warning t) + (,slotsv (list :type ,typev :lambda `',,lambdav))) (multiple-value-bind (,formsv ,declarations) (parse-body ,body :documentation t) (when (> (length ,declarations) 1) @@ -294,7 +295,8 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV." ;; Properties with :HOSTATTRS subroutines which set ;; new hostattrs should not be used programmatically ;; in this way, so issue a warning. - ,@(and (getf ,slotsv :hostattrs) + ,@(and programmatic-warning + (getf ,slotsv :hostattrs) `((warn 'programmatic-apply-hostattrs :property ',,name))) (consfigure (cons ',,name args))))))))))))) @@ -401,6 +403,8 @@ You can usually use DEFPROPLIST instead of DEFPROPSPEC, which see." ,@(ordinary-ll-variable-names lambda :include-supplied-p t))))) ,@(cdr (pop forms)))))) + (unless (getf slots :hostattrs) + (setq programmatic-warning nil)) (setf (getf slots :hostattrs) `(lambda (plist) ,@(cddr (getf slots :hostattrs)) -- cgit v1.2.3