[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v9 10/18] module: Add (scheme comparator).
From: |
Maxim Cournoyer |
Subject: |
[PATCH v9 10/18] module: Add (scheme comparator). |
Date: |
Tue, 12 Dec 2023 23:37:49 -0500 |
* 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
- [PATCH v9 00/18] Add SRFI 209 and dependencies; improve support for R7RS libraries, Maxim Cournoyer, 2023/12/12
- [PATCH v9 01/18] ice-9: Fix 'include' when used in compilation contexts., Maxim Cournoyer, 2023/12/12
- [PATCH v9 02/18] Use R7RS 'rename' syntax for exports., Maxim Cournoyer, 2023/12/12
- [PATCH v9 03/18] r7rs-libraries: Add support for 'else' clause in cond-expand., Maxim Cournoyer, 2023/12/12
- [PATCH v9 04/18] r7rs-libraries: Better support R7RS SRFI library names., Maxim Cournoyer, 2023/12/12
- [PATCH v9 05/18] (scheme base): Support non-negative SRFI integer names in cond-expand., Maxim Cournoyer, 2023/12/12
- [PATCH v9 06/18] Share features tested by cond-expand library declarations and expressions., Maxim Cournoyer, 2023/12/12
- [PATCH v9 07/18] build: Register '.sld' as an alternative extension to '.scm'., Maxim Cournoyer, 2023/12/12
- [PATCH v9 10/18] module: Add (scheme comparator).,
Maxim Cournoyer <=
- [PATCH v9 11/18] module: Add (scheme sort)., Maxim Cournoyer, 2023/12/12
- [PATCH v9 08/18] module: Add SRFI 126., Maxim Cournoyer, 2023/12/12
- [PATCH v9 09/18] module: Add SRFI 128., Maxim Cournoyer, 2023/12/12
- [PATCH v9 12/18] module: Add SRFI 125., Maxim Cournoyer, 2023/12/12
- [PATCH v9 13/18] module: Add SRFI 151., Maxim Cournoyer, 2023/12/12
- [PATCH v9 15/18] module: Add SRFI 178., Maxim Cournoyer, 2023/12/12
- [PATCH v9 14/18] module: Add SRFI 160., Maxim Cournoyer, 2023/12/12
- [PATCH v9 17/18] module: Add SRFI 48., Maxim Cournoyer, 2023/12/12
- [PATCH v9 16/18] module: Add SRFI 209., Maxim Cournoyer, 2023/12/12
- [PATCH v9 18/18] module: Upgrade SRFI 64 to modern R7RS library implementation., Maxim Cournoyer, 2023/12/12