From 2d7036f910bc58c5d791dba560e50ff18adfa70f Mon Sep 17 00:00:00 2001 From: Piotr Szarmanski Date: Fri, 25 Aug 2023 19:44:07 +0200 Subject: Remove function-cache, cached-lambda. --- src/cache.lisp | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/cache.lisp (limited to 'src/cache.lisp') 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) -- cgit v1.2.3