From 335bef85fdc01ac6000d084f1516744206a7eb53 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 24 Jun 2018 20:00:04 +0200 Subject: [PATCH] Remove unused memoize library --- core/autoload/memoize.el | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 core/autoload/memoize.el diff --git a/core/autoload/memoize.el b/core/autoload/memoize.el deleted file mode 100644 index 8d82c3d77..000000000 --- a/core/autoload/memoize.el +++ /dev/null @@ -1,31 +0,0 @@ -;;; core/autoload/memoize.el -*- lexical-binding: t; -*- - -;;;###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.") - -;;;###autoload -(defun doom-memoize (name) - "Memoizes an existing function. NAME is a symbol." - (let ((func (symbol-function name))) - (put name 'function-documentation - (concat (documentation func) " (memoized)")) - (fset name - `(lambda (&rest args) - (let ((key (cons ',name args))) - (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'." - (declare (indent defun) (doc-string 3)) - `(,(if (bound-and-true-p byte-compile-current-file) - 'with-no-warnings - 'progn) - (defun ,name ,arglist ,@body) - (doom-memoize ',name))) -