diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-17 23:49:47 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-18 09:55:57 -0700 |
commit | cf92e8a7379ceaae4f8f226c1540047df065aa01 (patch) | |
tree | 025e43c126e61135e53af9b4d091cf61b1199d49 /src/property.lisp | |
parent | e9253b36fb98b0cd34dd2be9693240648bb031c8 (diff) | |
download | consfigurator-cf92e8a7379ceaae4f8f226c1540047df065aa01.tar.gz |
DEFPROPSPEC needs to store lambda expressions, not calls to FUNCTION
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r-- | src/property.lisp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/property.lisp b/src/property.lisp index b965bc8..b2c2d0c 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -280,15 +280,6 @@ Use DEFPROPLIST/DEFPROPSPEC to avoid trouble.")) (setf (getf slots kw) `(lambda ,lambda ,@slot))))) -(defun defpropspec-preprocess (&rest args) - (list (list :propspec nil :orig-args args))) - -(defun defpropspec-apply (plist) - (propappapply (eval-propspec (getf plist :propspec)))) - -(defun defpropspec-unapply (plist) - (propappunapply (eval-propspec (getf plist :propspec)))) - (define-property-defining-macro defpropspec (type lambda slots forms) "Define a property which constructs, evaluates and applies a propspec. This is how you can define a property which works by calling other properties, @@ -317,9 +308,15 @@ You can usually use DEFPROPLIST instead of DEFPROPSPEC, which see." ;; resulting propspec at the other end of the pointer, so that the :APPLY ;; and :UNAPPLY subroutines can get at it. We have to keep the original ;; arguments to the propapp around for the sake of the :DESC subroutine. - (setf (getf slots :preprocess) '#'defpropspec-preprocess) - (setf (getf slots :apply) '#'defpropspec-apply) - (setf (getf slots :unapply) '#'defpropspec-unapply) + (setf (getf slots :preprocess) + '(lambda (&rest args) + (list (list :propspec nil :orig-args args)))) + (setf (getf slots :apply) + '(lambda (plist) + (propappapply (eval-propspec (getf plist :propspec))))) + (setf (getf slots :unapply) + '(lambda (plist) + (propappunapply (eval-propspec (getf plist :propspec))))) (when (and (listp (car forms)) (eq :desc (caar forms))) (setf (getf slots :desc) `(lambda (plist) |