[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: thunk.el: Document that thunk-force == funcall?
From: |
Tomas Hlavaty |
Subject: |
RE: thunk.el: Document that thunk-force == funcall? |
Date: |
Thu, 19 Nov 2020 00:25:17 +0100 |
On Thu 19 Nov 2020 at 00:05, Tomas Hlavaty <tom@logand.com> wrote:
> (let ((void (list nil)))
> (defun memoize (thunk)
> (let ((z void))
> (lambda ()
> (when (eq z void)
> (setq z (funcall thunk)))
> z))))
it would be better to "free" the thunk:
(let ((void (list nil)))
(defun memoize (thunk)
(let ((z void))
(lambda ()
(when (eq z void)
(setq z (funcall thunk)
thunk nil))
z))))
interesting drawback of thunk.el implementation is that thunk-delay does
not allow that and whatever is captured stays captured even after
thunk-force.
- Re: thunk.el: Document that thunk-force == funcall?, (continued)
- Re: thunk.el: Document that thunk-force == funcall?, Tomas Hlavaty, 2020/11/18
- Re: thunk.el: Document that thunk-force == funcall?, Stefan Monnier, 2020/11/18
- Re: thunk.el: Document that thunk-force == funcall?, Tomas Hlavaty, 2020/11/18
- Re: thunk.el: Document that thunk-force == funcall?, Stefan Monnier, 2020/11/18
- Re: thunk.el: Document that thunk-force == funcall?, Tomas Hlavaty, 2020/11/18
- Re: thunk.el: Document that thunk-force == funcall?, Stephen Leake, 2020/11/18
Re: thunk.el: Document that thunk-force == funcall?, Alfred M. Szmidt, 2020/11/18
RE: thunk.el: Document that thunk-force == funcall?, Drew Adams, 2020/11/17
RE: thunk.el: Document that thunk-force == funcall?, Tomas Hlavaty, 2020/11/19
RE: thunk.el: Document that thunk-force == funcall?, Nicolas Petton, 2020/11/19
Re: thunk.el: Document that thunk-force == funcall?, Stefan Monnier, 2020/11/17