File: README.md

package info (click to toggle)
emacs-memoize 1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 68 kB
  • sloc: lisp: 137; makefile: 19
file content (24 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Elisp memoization functions

See the header in the source file for details. It's very easy to use:

```cl
(require 'memoize)

(memoize 'my-function)
```

The macro `defmemoize` is also provided to directly create memoized
functions:

```cl
(defmemoize my-expensive-function (x)
  (if (zerop n)
      1
    (* n (my-expensive-function (1- n)))))
```

Some functions are run over buffer contents, and need to be cached
only so long as the buffer contents do not change. For these
use-cases, we have the function `memoize-by-buffer-contents` as well
as the `defmemoize-by-buffer-contents` macro.