Hi,

while playing with current Guile main on Windows, I found some problems
in the implementation of custom-ports that was recently committed.
Please consider the attached patches.

Regards
Jonas
From b5f1013ad969b6e4e35b36dc63798375ffbecda3 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <hah...@hahnjo.de>
Date: Tue, 24 Oct 2023 12:47:21 +0200
Subject: [PATCH 1/2] Fix loading of custom-ports extension

* module/ice-9/custom-ports.scm: Load extension also in expand and eval.
---
 module/ice-9/custom-ports.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/ice-9/custom-ports.scm b/module/ice-9/custom-ports.scm
index ba50d238a..07b6ba28a 100644
--- a/module/ice-9/custom-ports.scm
+++ b/module/ice-9/custom-ports.scm
@@ -74,7 +74,7 @@
 (define-custom-port-dispatcher truncate length)
 
 
-(eval-when (load)
+(eval-when (expand load eval)
   (load-extension (string-append "libguile-" (effective-version))
                   "scm_init_custom_ports"))
 
-- 
2.42.0

From 78c97b8a49ba336516e954c6c62e4baa7f429f47 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <hah...@hahnjo.de>
Date: Tue, 24 Oct 2023 19:24:22 +0200
Subject: [PATCH 2/2] Match on correct argument in make-custom-port

* module/ice-9/custom-ports.scm (make-custom-port): Match on correct
argument for conversion strategy.
---
 module/ice-9/custom-ports.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/ice-9/custom-ports.scm b/module/ice-9/custom-ports.scm
index 07b6ba28a..6010fd94f 100644
--- a/module/ice-9/custom-ports.scm
+++ b/module/ice-9/custom-ports.scm
@@ -146,7 +146,7 @@ methods."
       ((? symbol?)
        (string->symbol (string-upcase (symbol->string encoding))))))
   (define (canonicalize-conversion-strategy conversion-strategy)
-    (match encoding
+    (match conversion-strategy
       ('escape 'escape)
       ('substitute 'substitute)
       (_ 'error)))
-- 
2.42.0

Attachment: signature.asc
Description: This is a digitally signed message part

  • [PATCH] Fixes for... Developers list for Guile, the GNU extensibility library

Reply via email to