From b5b11a65664638f1f72d6300eb79661c41965d29 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 4 Jun 2021 16:52:53 -0700 Subject: include name of property in programmatic application warning Signed-off-by: Sean Whitton --- src/property.lisp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/property.lisp b/src/property.lisp index c6512cd..9816ce8 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -295,16 +295,17 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV." ;; new hostattrs should not be used programmatically ;; in this way, so issue a warning. ,@(and (getf ,slotsv :hostattrs) - '((programmatic-apply-hostattrs))) + `((warn 'programmatic-apply-hostattrs + :property ',,name))) (consfigure (cons ',,name args))))))))))))) -(define-condition programmatic-apply-hostattrs (simple-warning) ()) - -(defun programmatic-apply-hostattrs () - (warn 'programmatic-apply-hostattrs - :format-control - "Calling property which has :HOSTATTRS subroutine programmatically. -Use DEFPROPLIST/DEFPROPSPEC to avoid trouble.")) +(define-condition programmatic-apply-hostattrs (warning) + ((property :initarg :property)) + (:report (lambda (condition stream) + (format stream "Calling property ~S, +which has :HOSTATTRS subroutine, programmatically. Use DEFPROPLIST/DEFPROPSPEC +to avoid trouble." + (slot-value condition 'property))))) (defmacro ignoring-hostattrs (form) "Where FORM is a programmatic call to a property which has a :HOSTATTRS -- cgit v1.2.3