I have a patch for supporting C6 with SRFI-158.

I did not test with test-new-egg as I do not control the upstream repo (I believe Vasilij does), but I wasn't sure how else to contribute this than to just push a patch to the mailing list.

Cheers,
--
Jeremy Steward
From c2b83bbc47f6022b630684e227f95ff1f3671650 Mon Sep 17 00:00:00 2001
From: Jeremy Steward <[email protected]>
Date: Wed, 11 Feb 2026 20:13:38 -0700
Subject: [PATCH] Fix imports for C6 support

---
 srfi-158-module.scm | 33 +++++++++++++++++++++++----------
 tests/run.scm       | 27 ++++++++++++++++++++-------
 2 files changed, 43 insertions(+), 17 deletions(-)

diff --git a/srfi-158-module.scm b/srfi-158-module.scm
index 616057c..a2ad19c 100644
--- a/srfi-158-module.scm
+++ b/srfi-158-module.scm
@@ -1,12 +1,22 @@
 (module srfi-158 ()
-  (import scheme)
-  ;; Provide necessary R7RS-small identifiers
-  (import (only (chicken base) include case-lambda call/cc when error
-                let-values define-values open-input-string))
-  (import (only (srfi 4) make-u8vector u8vector u8vector-ref
-                u8vector-set! u8vector-length))
-  (import (only (chicken module) export))
-  (import (only (chicken platform) register-feature!))
+  (cond-expand
+    (chicken-6
+      (import (scheme base)
+              (scheme case-lambda)
+              (scheme read)
+              (only (srfi 4) make-u8vector u8vector u8vector-ref
+                    u8vector-set! u8vector-length)
+              (only (chicken module) export)
+              (only (chicken platform) register-feature!)))
+    (else
+      (import scheme)
+      ;; Provide necessary R7RS-small identifiers
+      (import (only (chicken base) include case-lambda call/cc when error
+                    let-values define-values open-input-string))
+      (import (only (srfi 4) make-u8vector u8vector u8vector-ref
+                    u8vector-set! u8vector-length))
+      (import (only (chicken module) export))
+      (import (only (chicken platform) register-feature!))))
   (export generator circular-generator make-iota-generator make-range-generator
           make-coroutine-generator list->generator vector->generator
           reverse-vector->generator string->generator
@@ -26,6 +36,9 @@
           string-accumulator bytevector-accumulator bytevector-accumulator!
           sum-accumulator product-accumulator)
   (register-feature! 'srfi-158)
-  (include "srfi-158/r7rs-shim.scm")
+  (cond-expand
+    (chicken-6)
+    (else
+      (include "srfi-158/r7rs-shim.scm")))
   (include "srfi-158/srfi-158-impl.scm")
-)
+  )
diff --git a/tests/run.scm b/tests/run.scm
index 2022ab4..2439df8 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -1,8 +1,21 @@
-(import scheme)
-(import test)
-(import (srfi 158))
-(import (only (srfi 1) unfold))
-(import srfi-4)
-(import (only (chicken port) with-input-from-string))
-(include "../srfi-158/r7rs-shim.scm")
+(cond-expand
+  (chicken-6
+    (import (scheme base)
+            (only (srfi 1) unfold)
+            (srfi 4)
+            (srfi 158)
+            (test)
+            (only (chicken port) with-input-from-string)))
+  (else
+    (import scheme)
+    (import test)
+    (import (srfi 158))
+    (import (only (srfi 1) unfold))
+    (import srfi-4)
+    (import (only (chicken port) with-input-from-string))))
+
+(cond-expand
+  (chicken-6)
+  (else
+    (include "../srfi-158/r7rs-shim.scm")))
 (include "../srfi-158/chicken-test.scm")
-- 
2.43.0

Reply via email to