From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yLCoH5DeMWK5bAEAgWs5BA (envelope-from ) for ; Wed, 16 Mar 2022 13:56:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qIR5GJDeMWJ5aQEAG6o9tA (envelope-from ) for ; Wed, 16 Mar 2022 13:56:48 +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 F12A02C71F for ; Wed, 16 Mar 2022 13:56:47 +0100 (CET) Received: from localhost ([::1]:42420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nUTCo-00049w-NA for larch@yhetil.org; Wed, 16 Mar 2022 08:56:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUT1S-00078S-Q1 for guix-patches@gnu.org; Wed, 16 Mar 2022 08:45:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nUT1S-0004VB-DF 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 1nUT1S-0001kF-BV for guix-patches@gnu.org; Wed, 16 Mar 2022 08:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#53765] [PATCH v2 05/18] 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: Wed, 16 Mar 2022 12:45: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 Cc: Maxime Devos Received: via spool by 53765-submit@debbugs.gnu.org id=B53765.16474346486447 (code B ref 53765); Wed, 16 Mar 2022 12:45:02 +0000 Received: (at 53765) by debbugs.gnu.org; 16 Mar 2022 12:44:08 +0000 Received: from localhost ([127.0.0.1]:50533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUT0Z-0001fu-Px for submit@debbugs.gnu.org; Wed, 16 Mar 2022 08:44:08 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:41186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUT0W-0001eI-5I for 53765@debbugs.gnu.org; Wed, 16 Mar 2022 08:44:04 -0400 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-101.mailbox.org (Postfix) with ESMTPS id 4KJVML2QYGz9sW3; Wed, 16 Mar 2022 13:43:58 +0100 (CET) From: Reily Siegel DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reilysiegel.com; s=MBO0001; t=1647434638; 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=6fPmdcWUyry7/sz8KHi8h0PQbIUrFDTTTUFFYP8kJGg=; b=jVBPHR45nJ+E/qszp+j1uC8YvJzBfYe+u9IjFZya+CPIDCE27GlGkoKXFYBjyArCEw8Q1w bvFfhaEWnTFUPSK+bwt4mNvtE3NTGMD4gV49LqKwknN4yqebvOboNnRmWU+SxieOep8+zO vvacjPnkCOj/5x9ZOhsiKzy8bfsR9ZjlaGvw7+bF6RlrPLn+6NfKPtTmXz/5n5w/PSfHOv 6eFAXdEWCBg8uEsRpyfXikSEzVSDIiBs1wOA5S4oHbFRvXS3SPk/xkmr6WzSVabHK8tIhq W5ZDgS2Ytu8rZeUxytK20FDqoUpO8NuXCFqwCm7dYhyOGtZE4Vg4SXWuIt1IhQ== Date: Wed, 16 Mar 2022 13:43:55 +0100 Message-ID: <877d8udq44.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=1647435408; 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=6fPmdcWUyry7/sz8KHi8h0PQbIUrFDTTTUFFYP8kJGg=; b=mImvXM9sxiPZKeida+e17arxDpjQYZCFX3BGtExVXuUYRP+ipiRDFjIEIbj8ydBl17WPXq oOZ9ohXPAcYex7ASiFU9rSdyLJPHitd3CZDdCat5XFvXpOPGmCtfAJ/TvRoRqyHA3QO5cM ZXsqnpFYQG7T3JzAhZHINbZiLpd+A1LBKFPHMeTaq1qhg4IBFtM3IP8DAdjqvL2XORrybw d0H7VSsN8MIQWQ5TyZfXD2eVQQmi435/HQaKRDshpyPCeHjsEv+Qs9P9EP5xvG9u4YJNXJ OVPeUJl3D3a51RV39qJFHoRDT1LWnCgviBgpfzQZ3bCABhrsEIUc7Fmqat+Nfw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647435408; a=rsa-sha256; cv=none; b=bHqdBPw8FVGFgsKqzKRz7eJ1FgqxxzxstKp4MwFnG62NWCj0kiQzQX3L8FIqJmF1iWuAOv T8++lpPjYnwHfXZYhSlkG/FrdwxUNv1Vpo7NxmQ/PPQTE9hQ0qfqvcFcF4zJAGKenQ0hBJ 9AvgzA74hGXota4B9GBVM2l2/pX5XTrQgDFQ02ZvjTjPZbCSny3Drb9qO6mRPwccU/DDGg igYVz/EymAlh+z7d0yXo49iBGy9kS5/vpWeEyQUuzRpf/bxpo8prWT1X+j042OyWjDiMQA qpzFbA1BHct2al4rE09MWSe28cf01bATHIc403eEVx7RDv4MGUXpP8CM2bFKqg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=jVBPHR45; 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.36 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=jVBPHR45; 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: F12A02C71F X-Spam-Score: -0.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: BDeh1TI4xlpR * 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 37cea74c95..d6c8218f93 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 -- Reily Siegel