diff options
author | Piotr Szarmanski | 2023-08-25 19:44:07 +0200 |
---|---|---|
committer | Piotr Szarmanski | 2023-08-25 19:44:07 +0200 |
commit | 2d7036f910bc58c5d791dba560e50ff18adfa70f (patch) | |
tree | 1f2d648e6458bdf97c9b8dd15f70dc6509c0d9ba /src/cache.lisp | |
parent | fed34b8df2b19ba996ef810f44d5666437c90fb7 (diff) |
Remove function-cache, cached-lambda.
Diffstat (limited to 'src/cache.lisp')
-rw-r--r-- | src/cache.lisp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/cache.lisp b/src/cache.lisp deleted file mode 100644 index d6bce9c..0000000 --- a/src/cache.lisp +++ /dev/null @@ -1,45 +0,0 @@ -;; This is a patch for function-cache, enabling a per-stream cache for -;; eris-decode-stream. - -(in-package :function-cache) - -(defmacro cached-lambda (cache-list lambda-list &body body) - "Creates a cached lambda function with the cache-list - cache-list is a list (&rest CACHE-INIT-ARGS - &key CACHE-CLASS TABLE TIMEOUT SHARED-RESULTS?) - - TABLE - a shared cache-store to use, usually a hash-table, a function that returns - a hashtable, or a symbol whose value is a hash-table - TIMEOUT - how long entries in the cache should be considered valid for - CACHE-CLASS - controls what cache class will be instantiated (uses - default-cache-class if not provided) - SHARED-RESULTS? - do we expect that we are sharing cache space with other things - defaults to t if TABLE is provided - CACHE-INIT-ARGS - any other args that should be passed to the cache - " - (destructuring-bind (&rest cache-args - &key table (shared-results? nil shared-result-input?) - cache-class - &allow-other-keys) - (ensure-list cache-list) - (declare (ignore cache-class)) ;; handled in default-cache-class - (remf cache-args :cache-class) - (remf cache-args :table) - (remf cache-args :shared-results?) - (when (and table (not shared-result-input?)) (setf shared-results? t)) - (let* ((cache-class (default-cache-class (cons nil cache-list) lambda-list)) - (call-list (%call-list-for-lambda-list lambda-list)) - (cache (gensym))) - `(let ((,cache - (make-instance ',cache-class - :body-fn (lambda ,lambda-list - ,@body) - :name nil - :lambda-list ',lambda-list - :shared-results? ,shared-results? - :cached-results ,table - ,@cache-args))) - (lambda ,lambda-list - (cacher ,cache ,call-list)))))) - -(export 'cached-lambda) |