From patchwork Fri Feb 4 00:24:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reily Siegel X-Patchwork-Id: 36969 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DFA3927BBEA; Fri, 4 Feb 2022 00:26:04 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9EC0227BBE9 for ; Fri, 4 Feb 2022 00:26:04 +0000 (GMT) Received: from localhost ([::1]:48144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFmQN-0001WS-QV for patchwork@mira.cbaines.net; Thu, 03 Feb 2022 19:26:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFmPP-0000VA-C3 for guix-patches@gnu.org; Thu, 03 Feb 2022 19:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFmPP-0001kI-2Y for guix-patches@gnu.org; Thu, 03 Feb 2022 19:25:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nFmPP-000051-02 for guix-patches@gnu.org; Thu, 03 Feb 2022 19:25:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53765] [PATCH 04/17] gnu: Add clojure-core-cache. References: <87y22r32hi.fsf@reilysiegel.com> In-Reply-To: <87y22r32hi.fsf@reilysiegel.com> Resent-From: Reily Siegel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 04 Feb 2022 00:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53765 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53765@debbugs.gnu.org Received: via spool by 53765-submit@debbugs.gnu.org id=B53765.164393429232716 (code B ref 53765); Fri, 04 Feb 2022 00:25:02 +0000 Received: (at 53765) by debbugs.gnu.org; 4 Feb 2022 00:24:52 +0000 Received: from localhost ([127.0.0.1]:58295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFmPE-0008Vb-0T for submit@debbugs.gnu.org; Thu, 03 Feb 2022 19:24:52 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:34358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFmPB-0008VD-IR for 53765@debbugs.gnu.org; Thu, 03 Feb 2022 19:24:50 -0500 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Jqbrq2Mggz9sS2 for <53765@debbugs.gnu.org>; Fri, 4 Feb 2022 01:24:43 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reilysiegel.com; s=MBO0001; t=1643934280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=JmIBMC9IcWHR+svWDy2IbAMJS/gkUbzA/0M+8PGxTFk=; b=WYZnPp1R4CjN2ianopLTDlciWstBMerykk2I2twjg7ZDEUXUWNteZHr0I6GzwCYBAVj+Rt TBUudmY7teLsS13U/lXsV65oCznWD/375nkBl4r+DQrWc0SRj3E0ozuNG3um0g3wiuig6m voqQ9KQH7WjmzSdMo9d++ZfdA/We3eolt+sqVc3rnYFIpJ68pR+YZErxhmE2/GD0Eatbyh oz3LEzjI+rebuZHS7R85BpTMAWmtIIhPN7VG08PS2PG9kSTqQynZNN3Ho2s2frsV5AQ/HE RtNUMNUbkdqrym0afbHXY1Wp7PMk+FinPtSZ9Mn2XKRW2vYWcXI6D2FKbw824A== From: Reily Siegel Date: Thu, 03 Feb 2022 19:24:35 -0500 Message-ID: <87sfsz32d8.fsf@reilysiegel.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/clojure.scm (clojure-core-cache): New variable. --- gnu/packages/clojure.scm | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm index c4524c2abb..d390feff3d 100644 --- a/gnu/packages/clojure.scm +++ b/gnu/packages/clojure.scm @@ -259,6 +259,61 @@ (define-public clojure-algo-monads (home-page "https://github.com/clojure/algo.monads") (license license:epl1.0))) +(define-public clojure-core-cache + (package + (name "clojure-core-cache") + (version "1.0.225") + (home-page "https://github.com/clojure/core.cache") + (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 + "1dr1ply7ffdbd6bv4gygzmc0wx3q7zwzaaa1p93s28jkfp28276l")))) + (build-system clojure-build-system) + (arguments + '(#:source-dirs '("src/main/clojure") + #:test-dirs '("src/test/clojure") + #:doc-dirs '("doc"))) + (propagated-inputs (list clojure-data-priority-map)) + (synopsis "Caching library for Clojure implementing various cache strategies") + (description "@code{core.cache} is a Clojure contrib library providing the +following features: + +An underlying CacheProtocol used as the base abstraction for implementing new +synchronous caches + +A defcache macro for hooking your CacheProtocol implementations into the +Clojure associative data capabilities. + +Implementations of some basic caching strategies + +First-in-first-out (FIFOCache) +Least-recently-used (LRUCache) +Least-used (LUCache -- sometimes called Least Frequently Used) +Time-to-live (TTLCacheQ) +Naive cache (BasicCache) +Naive cache backed with soft references (SoftCache) + +Implementation of an efficient buffer replacement policy based on the low +inter-reference recency set algorithm (LIRSCache) described in the LIRS paper + +Factory functions for each existing cache type + +Caches are generally immutable and should be used in conjunction with +Clojure's state management, such as atom. SoftCache is the exception here, +built on top of mutable Java collections, but it can be treated as an +immutable cache as well. + +The @code{clojure.core.cache} namespace contains the immutable caches +themselves. The @code{clojure.core.cache.wrapped} namespace contains the same +API operating on caches wrapped in atoms, which is the \"normal\" use in the +wild.") + (license license:epl1.0))) + (define-public clojure-core-match (let ((commit "1837ffbd4a150e8f3953b2d9ed5cf4a4ad3720a7") (revision "1")) ; this is the 1st commit buildable with clojure 1.9