[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 43c2cb0 2/2: Document with-memoization
From: |
Lars Ingebrigtsen |
Subject: |
master 43c2cb0 2/2: Document with-memoization |
Date: |
Mon, 4 Oct 2021 07:23:29 -0400 (EDT) |
branch: master
commit 43c2cb0a13343fe366452eea50eb4b36eee3c403
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Document with-memoization
* doc/misc/cl.texi (Modify Macros): Document with-memoization.
---
doc/misc/cl.texi | 6 ++++++
etc/NEWS | 2 ++
2 files changed, 8 insertions(+)
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index a6c3c32..1e5d40b 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -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
diff --git a/etc/NEWS b/etc/NEWS
index 7b4a29e..ef8d95a 100644
--- 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