From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.devel Subject: [PATCH v6 10/16] module: Add (scheme comparator). Date: Sat, 2 Dec 2023 20:37:11 -0500 Message-ID: <20231203014115.26985-11-maxim.cournoyer@gmail.com> References: <20231203014115.26985-1-maxim.cournoyer@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33055"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Maxim Cournoyer To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Dec 03 02:43:24 2023 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r9bW0-0008Nz-2c for guile-devel@m.gmane-mx.org; Sun, 03 Dec 2023 02:43:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9bUR-0001Qr-FJ; Sat, 02 Dec 2023 20:41:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9bUQ-0001QP-Jq for guile-devel@gnu.org; Sat, 02 Dec 2023 20:41:46 -0500 Original-Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9bUJ-0001YK-Q4 for guile-devel@gnu.org; Sat, 02 Dec 2023 20:41:46 -0500 Original-Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-77dd0756060so183868785a.1 for ; Sat, 02 Dec 2023 17:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701567698; x=1702172498; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pbExLAXtrXf7qiELXtrsEEZLtAqQAM5osBxU0I71bOQ=; b=PjOijj59+dITnrqovkaA35fczudJpBnFBIOfkST9f3U5/1Aclp4cr4S0aaKXvD7lFT U4LDs3e/ajDsSYddaqqj3lcQRvwv8KbLa6qXpeFUDPv7lwrnyY6fizLtymyIPB7l5MxH mUeWNNNJlu20AUS0lmDnq252vjGIATMpOe4v+xizqpgIPmt2tw1ZNfCUx79aKDpBsuE7 R0VtO+UtW8hWuwVoW5YmFZqlOn8LjtsFXeAxfgT9zc3Oc/PbHTMweCDX4cF7pw9J+LPc T0Bv3/8oujsbk2SPtkemUrXldEQ/cMLYEL8GJFFP6QAfC7MA+flm8RIGbpbfjrx5OIll 4m+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701567698; x=1702172498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pbExLAXtrXf7qiELXtrsEEZLtAqQAM5osBxU0I71bOQ=; b=RtFUllEZ3LzM2GM/4krujAaphU07c8Vy5Eun/VLC5Z2uJkc9SkjNlMPeQiedfxmey0 n/ZGv4Vbo63ApCGmD0VyJ+p1o0zlIF/0OGqKwPLz1G3YqnTvPpHNxGQNyNLtQZBXC+Qr m6SDDVepEtom3bvbtyZc0Ea2VkyCbtSiFjAJR650Cn/ex6s5/kkiwC0OT7N9S5y8Sb/I PhUsG6g5PcmMDxj3VSv5gjQElvKTc57lLHlsnl7cPlmXjVcbHGtgHQ6fkpJ8RMtjUZIm OuYJTZqC+Z0eiBUD1x6UBHcZ1rGe7MJIHiVsBXypFqSgOUZM2sV2anHBjoAnvCjpWOT2 aoNw== X-Gm-Message-State: AOJu0YzBCs+kh+o9lZbflv3hT5gNJhQ/mMVOxxI+2ttjXZHrHmmDl2kM +HUxgq0I3XFSFzbyNekrAaSv/szBwJk= X-Google-Smtp-Source: AGHT+IFLm8p1YKNRu3bFtij4OXeO8+g2XUpDRJ5sQlHBJDBpdgemUOMu03DsKOmfxvI4MfyIb4oTEw== X-Received: by 2002:a05:620a:31b:b0:77d:98bc:fd7e with SMTP id s27-20020a05620a031b00b0077d98bcfd7emr1958615qkm.50.1701567698095; Sat, 02 Dec 2023 17:41:38 -0800 (PST) Original-Received: from localhost.localdomain (dsl-10-141-196.b2b2c.ca. [72.10.141.196]) by smtp.gmail.com with ESMTPSA id t15-20020a05620a450f00b0077dca8ed9a4sm2869664qkp.133.2023.12.02.17.41.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 17:41:37 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231203014115.26985-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x733.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22175 Archived-At: * module/scheme/comparator.sld: New R7RS library shim for SRFI 128. * am/bootstrap.am (SOURCES): Register it. * NEWS: Update NEWS. --- (no changes since v5) Changes in v5: - Update NEWS NEWS | 1 + am/bootstrap.am | 1 + module/scheme/comparator.sld | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 module/scheme/comparator.sld diff --git a/NEWS b/NEWS index 31107a76d..45023d9fb 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ the compiler reports it as "possibly unused". ** Add (srfi 126), a hash tables library ** Add (srfi 128), a comparators library +** Add (scheme comparator) * Bug fixes diff --git a/am/bootstrap.am b/am/bootstrap.am index 4404113ab..614d56d0d 100644 --- a/am/bootstrap.am +++ b/am/bootstrap.am @@ -277,6 +277,7 @@ SOURCES = \ scheme/base.scm \ scheme/case-lambda.scm \ scheme/char.scm \ + scheme/comparator.sld \ scheme/complex.scm \ scheme/cxr.scm \ scheme/eval.scm \ diff --git a/module/scheme/comparator.sld b/module/scheme/comparator.sld new file mode 100644 index 000000000..5016e4392 --- /dev/null +++ b/module/scheme/comparator.sld @@ -0,0 +1,33 @@ +;;; comparator.sld --- R7RS library exposing SRFI 128. + +;;; Copyright (C) 2023 Free Software Foundation, Inc. +;;; +;;; This library is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU Lesser General Public License as +;;; published by the Free Software Foundation, either version 3 of the +;;; License, or (at your option) any later version. +;;; +;;; This library is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; Lesser General Public License for more details. +;;; +;;; You should have received a copy of the GNU Lesser General Public +;;; License along with this program. If not, see +;;; . + +(define-library (scheme comparator) + (export comparator? comparator-ordered? comparator-hashable? + make-comparator + make-pair-comparator make-list-comparator make-vector-comparator + make-eq-comparator make-eqv-comparator make-equal-comparator + boolean-hash char-hash char-ci-hash + string-hash string-ci-hash symbol-hash number-hash + make-default-comparator default-hash comparator-register-default! + comparator-type-test-predicate comparator-equality-predicate + comparator-ordering-predicate comparator-hash-function + comparator-test-type comparator-check-type comparator-hash + hash-bound hash-salt + =? ? <=? >=? + comparator-if<=>) + (import (srfi 128))) -- 2.41.0