mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
core/autoload/memoize: add autoload cookies
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
;;; memoize.el
|
||||
(provide 'doom-lib-memoize)
|
||||
|
||||
;;;###autoload
|
||||
(defvar doom-memoized-table (make-hash-table :test 'equal :size 10)
|
||||
"A lookup table containing memoized functions. The keys are argument lists,
|
||||
and the value is the function's return value.")
|
||||
@ -14,6 +15,7 @@ and the value is the function's return value.")
|
||||
(or (gethash key doom-memoized-table)
|
||||
(puthash key (apply ',func args) doom-memoized-table))))))
|
||||
|
||||
;;;###autoload
|
||||
(defmacro def-memoized! (name arglist &rest body)
|
||||
"Create a memoize'd function. NAME, ARGLIST, DOCSTRING and BODY
|
||||
have the same meaning as in `defun'."
|
||||
|
Reference in New Issue
Block a user