Hi all,

Lassi Kortela posted a patch on IRC to fix the fact that our SRFI-17
module doesn't export the "setter" and "getter-with-setter" procedures.
If this is approved, please also apply it to the prerelease branch,
as it is both trivial and important enough to include.

PS: aren't all the register-primitive-module invocations for srfis wrong,
in that they register a module under a similarly named unit, but there
is no such unit library (in any of these cases)?

In other words, shouldn't register-primitive-module be defined like so:

;; same as register-core-module, but uses "library" as the library name
(define (##sys#register-primitive-module name vexports #!optional (sexports 
'()))
  (##sys#register-core-module name 'library vexports sexports))

Or, perhaps, it should be #f, since module-library can be false and
syntax-only libraries don't require a unit to be linked in.

Cheers,
Peter
From 86530c17b873c5063ff56275ea4d8e4af29d123f Mon Sep 17 00:00:00 2001
From: Peter Bex <[email protected]>
Date: Thu, 19 Aug 2021 13:45:29 +0200
Subject: [PATCH] Also export setter and getter-with-setter from builtin
 srfi-17 module

Thanks to Lassi Kortela for the patch.
---
 NEWS        | 9 ++++++++-
 modules.scm | 7 +++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 051b212d..c30c4395 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,11 @@
-5.3.0
+5.3.0rc2
+
+- Core libraries
+  - The srfi-17 module now exports the `getter-with-setter` and `setter`
+    procedures, not just the set! macro (thanks to Lassi Kortela)
+
+
+5.3.0rc1
 
 - Core libraries
   - Fixed an inadvertant error during error reporting in the `numerator`
diff --git a/modules.scm b/modules.scm
index 36d32032..cbe48fe7 100644
--- a/modules.scm
+++ b/modules.scm
@@ -1152,8 +1152,11 @@
 (##sys#register-primitive-module
  'srfi-16 '() (se-subset '(case-lambda) ##sys#chicken.base-macro-environment))
 
-(##sys#register-primitive-module
- 'srfi-17 '() (se-subset '(set!) ##sys#default-macro-environment))
+(##sys#register-core-module
+ 'srfi-17 'library
+ '((getter-with-setter . chicken.base#getter-with-setter)
+   (setter . chicken.base#setter))
+ (se-subset '(set!) ##sys#default-macro-environment))
 
 (##sys#register-core-module
  'srfi-23 'library '((error . chicken.base#error)))
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature

Reply via email to