GNU bug report logs - #53765
[PATCH 00/17] Remove limitations on clojure-tools

Previous Next

Package: guix-patches;

Reported by: Reily Siegel <mail <at> reilysiegel.com>

Date: Fri, 4 Feb 2022 00:23:01 UTC

Severity: normal

Tags: patch

Full log


Message #20 received at 53765 <at> debbugs.gnu.org (full text, mbox):

From: Reily Siegel <mail <at> reilysiegel.com>
To: 53765 <at> debbugs.gnu.org
Subject: [PATCH 05/17] gnu: Add clojure-core-memoize.
Date: Thu, 03 Feb 2022 19:24:42 -0500
* gnu/packages/clojure.scm (clojure-core-memoize): New variable.
---
 gnu/packages/clojure.scm | 51 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index d390feff3d..a0350290e5 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -341,6 +341,57 @@ (define-public clojure-core-match
       (home-page "https://github.com/clojure/core.match")
       (license license:epl1.0))))
 
+(define-public clojure-core-memoize
+  (package
+    (name "clojure-core-memoize")
+    (version "1.0.253")
+    (home-page "https://github.com/clojure/core.memoize")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1qky54v114sh3xn0lffwy7xx3wnnayk07fr2nvhd4lih84sv6rdz"))))
+    (build-system clojure-build-system)
+    (arguments
+     '(#:source-dirs '("src/main/clojure")
+       #:test-dirs '("src/test/clojure")
+       #:doc-dirs '("docs")
+       ;; Tests fail when AOT'd.
+       #:aot-exclude '(#:all)))
+    (propagated-inputs (list clojure-core-cache))
+    (synopsis "Manipulable, pluggable, memoization framework for Clojure")
+    (description "@code{core.memoize} is a Clojure contrib library providing
+the following features:
+
+An underlying PluggableMemoization protocol that allows the use of
+customizable and swappable memoization caches that adhere to the synchronous
+CacheProtocol found in core.cache
+
+Memoization builders for implementations of common caching strategies,
+including:
+
+First-in-first-out (clojure.core.memoize/fifo)
+
+Least-recently-used (clojure.core.memoize/lru)
+
+Least-used (clojure.core.memoize/lu)
+
+Time-to-live (clojure.core.memoize/ttl)
+
+Naive cache (memo) that duplicates the functionality of Clojure's memoize
+function but, unlike the built-in memoize function, ensures that in the case
+of concurrent calls with the same arguments, the memoized function is only
+invoked once; in addition memo can use metadata from the memoized function to
+ignore certain arguments for the purpose of creating the cache key, e.g.,
+allowing you to memoize clojure.java.jdbc functions where the first argument
+includes a (mutable) JDBC Connection object by specifying
+:clojure.core.memoize/args-fn rest in the metadata")
+    (license license:epl1.0)))
+
 (define-public clojure-data-codec
   (package
     (name "clojure-data-codec")
-- 
2.34.0




This bug report was last modified 3 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.