From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QDR0NfLdMWKwaAEAgWs5BA (envelope-from ) for ; Wed, 16 Mar 2022 13:54:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cIHgMvLdMWIVHgAA9RJhRA (envelope-from ) for ; Wed, 16 Mar 2022 13:54:10 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 696A036962 for ; Wed, 16 Mar 2022 13:54:10 +0100 (CET) Received: from localhost ([::1]:39698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUTAH-000261-Jx for larch@yhetil.org; Wed, 16 Mar 2022 08:54:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUT1S-00077Q-CO for guix-patches@gnu.org; Wed, 16 Mar 2022 08:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56675) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUT1S-0004Uf-0l for guix-patches@gnu.org; Wed, 16 Mar 2022 08:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nUT1R-0001k8-Vj for guix-patches@gnu.org; Wed, 16 Mar 2022 08:45:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#53765] [PATCH v2 04/18] 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: Wed, 16 Mar 2022 12:45:01 +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 Cc: Maxime Devos Received: via spool by 53765-submit@debbugs.gnu.org id=B53765.16474346456431 (code B ref 53765); Wed, 16 Mar 2022 12:45:01 +0000 Received: (at 53765) by debbugs.gnu.org; 16 Mar 2022 12:44:05 +0000 Received: from localhost ([127.0.0.1]:50530 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUT0X-0001ff-Dt for submit@debbugs.gnu.org; Wed, 16 Mar 2022 08:44:05 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:54010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUT0V-0001e6-4g for 53765@debbugs.gnu.org; Wed, 16 Mar 2022 08:44:03 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2: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-202.mailbox.org (Postfix) with ESMTPS id 4KJVMJ29CPz9sRB; Wed, 16 Mar 2022 13:43:56 +0100 (CET) From: Reily Siegel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reilysiegel.com; s=MBO0001; t=1647434635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=bmoyzolF4idrnEdRZAts+jG/3F4jhRSklyR6A3sSwm0=; b=PstAuY/9AQ2wHnu9GvHmQB0jnxLVQnjlJ8UVYBC3233LcUrY+rh7ulUcYy8mtGXwmP5oyT SdxYDdVtCA7/PTNDE7LVpWpPuwT6Pbh9ZPe8/bPjKckK+7DQWgdef5G6GtL0dWEQRyFrWF OWSxrljOcAUONU83I9I9rMmWfW9lvcRQCH1pfUsvC55PuTwS4tufFMfzdwUCWiY+i6uY+x FtGTSb2G2CDdKyG/lfwuZhALuIkWqtJZ2I8ZvKQVYVAiOEDYD2I9U0WT7BmSMA1oDWVQMp 1R41xa83yFOGT8G7h2EIJJ5BF2snxB06DPMtMjj+JklPg+dlwhUhYum6A5RETA== Date: Wed, 16 Mar 2022 13:43:53 +0100 Message-ID: <878rtadq46.fsf@reilysiegel.com> MIME-Version: 1.0 Content-Type: text/plain 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647435250; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=bmoyzolF4idrnEdRZAts+jG/3F4jhRSklyR6A3sSwm0=; b=S3ah8y7kOKIgV351GBHy8NS/HyUYMFns9CjENip6Haj5Fiwbi3PPt73hWRuM3qXn1H31rl uckwjwgNgQy+phiJyQgKotL3zt5vG3tUZORreLW7SHkJvYU7IN4LrrXIxxKt71X/lBo5PP vRkE2DU4GezfiQaQN0WDdd6dsIH72WG9edt5k4WjPO7MdiAdt9YlMkCyemSI5FXtjOQ8Ga bAzADbbpEAedARZFo7WOOCJlyooUIWxTX8ioDVdiK0Z8VW/Tkwk+qdGTsDvp2V5P433MLA qsNhlCCTPbgAXgZA2UKmTTYGc1djSsYqR5kLC8it+QKl1PlRdUa0PyoxVszHuw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647435250; a=rsa-sha256; cv=none; b=DQ7TWAIFQXw37mzEJRtPN4Fyqy8mM8E2gCVo9i7JTNb01WXPpnZiztse3/HBxfE+iYNdFJ BZ6dr0v3oRtzIsQR+hx2J9fCCrZFQRBJUk63Tuvh71D3oWs8TknppRQdXq8mr26xK/uS7O QX2HGSYudTMtH1zjgulNO0kfH8ntmVInRNKiI4jMUaVaP5fcvGlZfnNcUURD54pwwfP+xG b+lutW5j62NHfPF0ndIxv/3Frs+DLnwHFy6sWXzBTxCwhs6rkSrIRZQzb85z2HPfMCeGpV mKakNtg1ToixYUYD7ef3gnDDMpscUWtw13m4ZiTsPzkInqcDme2q9Vxzbi7LxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b="PstAuY/9"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 0.74 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b="PstAuY/9"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 696A036962 X-Spam-Score: 0.74 X-Migadu-Scanner: scn1.migadu.com X-TUID: KU+HBfvKzYO4 * 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 9911b14577..37cea74c95 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 -- 2.34.0 -- Reily Siegel