]> git.eshelyaron.com Git - emacs.git/commitdiff
Document with-memoization
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 4 Oct 2021 11:23:18 +0000 (13:23 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 4 Oct 2021 11:23:22 +0000 (13:23 +0200)
* doc/misc/cl.texi (Modify Macros): Document with-memoization.

doc/misc/cl.texi
etc/NEWS

index a6c3c32c0eb2259ac1ba57e0adbe3f1321ae6258..1e5d40b037735d6024c7d590d703eb93da92a75e 100644 (file)
@@ -1245,6 +1245,12 @@ blocks for other macros like @code{cl-incf}, and @code{cl-pushnew}.
 The @code{cl-letf} and @code{cl-letf*} macros are used in the processing
 of symbol macros; @pxref{Macro Bindings}.
 
+@defmac with-memoization @var{place} @var{code}@dots{}
+This macro provides a simple way to do memoization.  @var{code} is
+evaluated and then stashed in @var{place}.  If @var{place}'s value is
+non-@code{nil}, return that value instead of evaluating @var{code}.
+@end defmac
+
 
 @node Variable Bindings
 @section Variable Bindings
index 7b4a29e1b6640f8dc7f864c68bb0e3357d97df3a..ef8d95af0ba119ed12dd5039c55e531abb2c8771 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -78,6 +78,8 @@ The new ':doc-spec-function' element can be used to compute the
 mode (instead of at load time).
 
 ** subr-x
+
++++
 *** New macro 'with-memoization' provides a very primitive form of memoization
 
 \f