From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WN+uI3Zy/GHPcQEAgWs5BA (envelope-from ) for ; Fri, 04 Feb 2022 01:25:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cPUPIXZy/GE/ewAA9RJhRA (envelope-from ) for ; Fri, 04 Feb 2022 01:25:26 +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 22E75CAFF for ; Fri, 4 Feb 2022 01:25:26 +0100 (CET) Received: from localhost ([::1]:46956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFmPk-0000aO-Ev for larch@yhetil.org; Thu, 03 Feb 2022 19:25:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFmPP-0000Vo-Ql for guix-patches@gnu.org; Thu, 03 Feb 2022 19:25:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFmPP-0001of-HV 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-00005D-Ex for guix-patches@gnu.org; Thu, 03 Feb 2022 19:25:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53765] [PATCH 05/17] gnu: Add clojure-core-memoize. 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:03 +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.164393429632733 (code B ref 53765); Fri, 04 Feb 2022 00:25:03 +0000 Received: (at 53765) by debbugs.gnu.org; 4 Feb 2022 00:24:56 +0000 Received: from localhost ([127.0.0.1]:58298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFmPI-0008Vs-BX for submit@debbugs.gnu.org; Thu, 03 Feb 2022 19:24:56 -0500 Received: from mout-p-202.mailbox.org ([80.241.56.172]:51136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFmPG-0008VQ-AW for 53765@debbugs.gnu.org; Thu, 03 Feb 2022 19:24:55 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (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 4Jqbrw4W33z9sTF for <53765@debbugs.gnu.org>; Fri, 4 Feb 2022 01:24:48 +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=1643934286; 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=QD8ZqXRzdm/dI5eEF+uKWycHi2dEbUtN/LNfKbrHyOY=; b=Hy+3HmIUB4R1Qi3BrtzCyWbZgW9TtZZ5Owt5ccP64gnVrNWQVeCsuMyv3KlcxYYxsAJMiU uUBWez4vUI0kO96DrXYs+YE3Gu4m/59TK+NxOU1JYRUfqKq5gCVNvRSTe+07mk5aymsBYW Nj/0BUnLnr3vW4aXUiR2vBdtKqFJLN5pO4jIn9OQ7CIDYtzgwCtJCwEnSbQ58LHzW3pDUH 7UsfarXcrWP8qiopjT/p7j6MTCodKP7JsvNSI9oC9rzPkcyDltjcSMjoHJtHy5cupeR5rW ucl9pYsOPsYolXpk0oKMZDvJd7vx91mlZkFuzaO+1epUZ2dFfzLylrdzHvER8g== From: Reily Siegel Date: Thu, 03 Feb 2022 19:24:42 -0500 Message-ID: <87r18j32d1.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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643934326; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=QD8ZqXRzdm/dI5eEF+uKWycHi2dEbUtN/LNfKbrHyOY=; b=mbZqYC99xgKDnCeA+8UHYmk7nW4WXOlnb6ZNobKl2K/EHTrxq3ix1O2V+BBd6meRYFjDNv FkJ8nytGLOeqvWzRSKkQDftG8Pg04mcgMAXWK7BKQ7K5NZA2jg92zht6zl19md74MZV5qw jPiPUqLMO2re4iN9pUqzczfaPOP2PfUf0G5wzw3VpMrTx4ifulQ3jPksz9Bh7Gzxx2nEAs hr8EN1H8xifUtFyP3CnwlKGwt3zaWfOd67ENaaWg5cYq5saPLgHpZ1b0EJ2tsOJUUiehUE aNl7I9tUspH7dvvMeT9RQSmd6LJ7F9iKtgkfb87646g9xAwzWX1OZh9zkmr8OQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643934326; a=rsa-sha256; cv=none; b=ndOYM6JQ2vCFpm59chSi+KgZk6tf+vsG8a/wmPDf9UKRnxyFiY8YNeOeerfxi8CrpX4LvF thN9tWvFht2c+7RwMJczPYawnTOIuD7dRF1jLj4GLPCL3kl4/ojbTu0ILw8FIZQPoHtFOl puZYeGjusjdLEf2OqoaFHCTvWVF6IiwAdXyhtMufkbtuLmQZK2BVFaAW6O5hxK23aBD1L9 hbcydkxo3/amMssWPPVfjpwVjnbKtkq0Nysy/9M1PCbgQwywOczx82yMnhvCLMByrQni7L z0gK5SuZXRS4Nx1akevxQ5BDaOedFm6CcgGALFC//Tg9ViBflHGu6TTf1fv0DA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=Hy+3HmIU; 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: -3.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=Hy+3HmIU; 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: 22E75CAFF X-Spam-Score: -3.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: UvbTygTc4f2G * 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