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 v9 10/18] module: Add (scheme comparator). Date: Tue, 12 Dec 2023 23:37:49 -0500 Message-ID: <20231213044217.14093-11-maxim.cournoyer@gmail.com> References: <20231213044217.14093-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="21652"; 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 Wed Dec 13 05:42:54 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 1rDH5C-0005Mu-6K for guile-devel@m.gmane-mx.org; Wed, 13 Dec 2023 05:42:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDH50-0004KA-HS; Tue, 12 Dec 2023 23:42:42 -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 1rDH4y-0004J9-L4 for guile-devel@gnu.org; Tue, 12 Dec 2023 23:42:40 -0500 Original-Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDH4x-00073L-32 for guile-devel@gnu.org; Tue, 12 Dec 2023 23:42:40 -0500 Original-Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-4254223c150so46571451cf.1 for ; Tue, 12 Dec 2023 20:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702442558; x=1703047358; 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=mIyhYjS7ga2r9M7bfDX4zbFin7rucJZmoqdlvf+ooSw=; b=YX9LN9FKJ+kIyX7CK2RjH/Pr5KFhMR1pwxYh29aIza1twBQDSMvAp/1KNTlvdTqA6X 1B528K/AuusySUMfRBczF/If9zKYKdC14iKo/+1zXiuDXkIwHFH6SD3eOEKBOWMHGqRy ASc+4DeNpCj4k9gkGVB5djRqq6fhRdxouFUIBZMLvL4hZlEQb/Zt2lOpnyw42Y2zacPw eNbtMvQBGrtUwdSwLVMfj1fL1gThv7k3WgtMJHOeBW7WyrInxH9EOZkI3A3VbIcDJCmo agkU8EqJJ0oQdUGIIg1yF8x+B8UEVvpAJpE4cNT18VFkY6tXODG4qraO35tUh6ZrmqHe Fa/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702442558; x=1703047358; 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=mIyhYjS7ga2r9M7bfDX4zbFin7rucJZmoqdlvf+ooSw=; b=UjAopHASgo+8RtGY0o0WAu/P2dIudtks+opGWsjzt1i7ltsT47w5yJaHa4/k9FUpfH MFuaMM7bjOZrce7SEnUgLBSHbwek0rYJU4txKgj4NZq1dP9ExI/LC86EoJC9cBzk4nZ0 h01NLhe43YJ167o5yh7YNyfccqlZfo11dXGFwwl0L/HerLPinDd9+ez4ExzfJoYjt5aD L9GqfL1ACUWYmlhOvzj7xnsNb1KMG3YO2z7dHOeU8x+8Ve4j2kwmNVrQTeCP0SuZAQdm JbVBlavjqU6Bryk1WCg6dS5mfaix1ncAOKgCUVIpcYlIPv4JwB+XmM0IslUojTIOcoO5 +zCw== X-Gm-Message-State: AOJu0Yw4nzslj81vVPH+wpOlHIyWTVzjPYx0++t5PNLLKkf7UTLw7iCb ezz+8PHP/qIRQ8BMtkvLYH9vOdfC8BAgoQ== X-Google-Smtp-Source: AGHT+IHtvcu2fDlMI+67uqEIzj+t3607wQd1Rh0s6tP+qyr9qdDXYCpoWp7+q5LoxzAr7CUdn5DWbw== X-Received: by 2002:a05:622a:2d6:b0:425:4043:50fa with SMTP id a22-20020a05622a02d600b00425404350famr8641616qtx.137.1702442557826; Tue, 12 Dec 2023 20:42:37 -0800 (PST) Original-Received: from localhost.localdomain (dsl-157-186.b2b2c.ca. [66.158.157.186]) by smtp.gmail.com with ESMTPSA id s7-20020ac87587000000b004181138e0c0sm4621719qtq.31.2023.12.12.20.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 20:42:37 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231213044217.14093-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x835.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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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:22231 Archived-At: * module/scheme/comparator.sld: New R7RS-large library shim for SRFI 128. * am/bootstrap.am (SOURCES): Register it. * NEWS: Update NEWS. --- (no changes since v7) Changes in v7: - Register prerequisites for scheme/comparator.go in am/bootstrap.am Changes in v5: - Update NEWS NEWS | 1 + am/bootstrap.am | 2 ++ module/scheme/comparator.sld | 21 +++++++++++++++++++++ 3 files changed, 24 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 7eda62599..a335782ff 100644 --- a/am/bootstrap.am +++ b/am/bootstrap.am @@ -65,6 +65,7 @@ ice-9/psyntax-pp.go: ice-9/psyntax.scm ice-9/psyntax-pp.scm # Register inter-modules dependencies. srfi/srfi-126.go: srfi/srfi-1.go srfi/srfi-27.go srfi/srfi-128.go: srfi/srfi-69.go srfi/srfi-126.go +scheme/comparator.go: srfi/srfi-128.go # All sources. We can compile these in any order; the order below is # designed to hopefully result in the lowest total compile time. @@ -281,6 +282,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..2ce55809a --- /dev/null +++ b/module/scheme/comparator.sld @@ -0,0 +1,21 @@ +;;; comparator.sld --- R7RS library exposing SRFI 128. +;;; +;;; SPDX-FileCopyrightText: 2023 Free Software Foundation, Inc. +;;; +;;; SPDX-License-Identifier: LGPL-3.0-or-later + +(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