diff options
author | sterni <sternenseemann@systemli.org> | 2022-01-19T13·39+0100 |
---|---|---|
committer | sterni <sternenseemann@systemli.org> | 2022-01-26T17·43+0000 |
commit | 25cb0ad32ff197092262c74e944d254e901632bd (patch) | |
tree | 68b70050e7ea3fd7912849292be03d289864acd3 /third_party/lisp/sclf/lazy.lisp | |
parent | 40014c70b3b3545d2304411cb91b176d1a3e22d2 (diff) |
style(3p/lisp): expand tabs in npg, mime4cl and sclf r/3675
Done using find third_party/lisp/{sclf,mime4cl,npg} \ -name '*.lisp' -or -name '*.asd' \ -exec bash -c 'expand -i -t 8 "$0" | sponge "$0"' {} \; Change-Id: If84afac9c1d5cbc74e137a5aa0ae61472f0f1e90 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5066 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'third_party/lisp/sclf/lazy.lisp')
-rw-r--r-- | third_party/lisp/sclf/lazy.lisp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/third_party/lisp/sclf/lazy.lisp b/third_party/lisp/sclf/lazy.lisp index 18f6bfdb7109..34bae82ebb64 100644 --- a/third_party/lisp/sclf/lazy.lisp +++ b/third_party/lisp/sclf/lazy.lisp @@ -41,13 +41,13 @@ (if (forced-p promise) (promise-value promise) (prog1 (setf (promise-value promise) - (funcall (promise-procedure promise))) - (setf (promise-procedure promise) nil)))) + (funcall (promise-procedure promise))) + (setf (promise-procedure promise) nil)))) (defmacro deflazy (name value &optional documentation) `(defparameter ,name (lazy ,value) ,@(when documentation - (list documentation)))) + (list documentation)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -71,8 +71,8 @@ any other.")) (defclass lazy-slot-mixin () ((lazy-function :initarg :lazy - :reader lazy-slot-function - :initform nil)) + :reader lazy-slot-function + :initform nil)) (:documentation "Slot for LAZY-METACLASS classes. Lazy slots must be declared with the argument :LAZY which must be a function accepting the object @@ -100,20 +100,20 @@ instance as argument.")) (let ((ds (car direct-slots))) (if (typep ds 'lazy-direct-slot-definition) (let ((form (lazy-slot-function ds)) - (args (call-next-method))) - (when (or (getf args :initarg) - (getf args :initform)) - (error "Lazy slot ~S cannot have :INITARG nor :INITFORM arguments." ds)) - (list* :lazy - (cond ((and (listp form) - (eq 'lambda (car form))) - (compile nil form)) - ((symbolp form) - form) - (t (compile nil `(lambda (self) - (declare (ignorable self)) - ,form)))) - args)) + (args (call-next-method))) + (when (or (getf args :initarg) + (getf args :initform)) + (error "Lazy slot ~S cannot have :INITARG nor :INITFORM arguments." ds)) + (list* :lazy + (cond ((and (listp form) + (eq 'lambda (car form))) + (compile nil form)) + ((symbolp form) + form) + (t (compile nil `(lambda (self) + (declare (ignorable self)) + ,form)))) + args)) (call-next-method)))) (defmethod slot-value-using-class ((class lazy-metaclass) instance (slot lazy-slot-mixin)) @@ -122,7 +122,7 @@ instance as argument.")) ;; instance and memoize the value in the slot. (unless (slot-boundp-using-class class instance slot) (setf (slot-value-using-class class instance slot) - (funcall (lazy-slot-function slot) instance))) + (funcall (lazy-slot-function slot) instance))) (call-next-method)) (defun reset-lazy-slots (object) @@ -131,4 +131,4 @@ re-evaluated next time their value is requested again." (be* class (class-of object) (dolist (slot (class-slots class)) (when (typep slot 'lazy-effective-slot-definition) - (slot-makunbound object (slot-definition-name slot)))))) \ No newline at end of file + (slot-makunbound object (slot-definition-name slot)))))) \ No newline at end of file |