unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Jonas Hahnfeld via "Developers list for Guile, the GNU extensibility library" <guile-devel@gnu.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: [PATCH] Fixes for custom-ports
Date: Sun, 29 Oct 2023 10:51:34 +0100	[thread overview]
Message-ID: <441968d3aa118c66ddc376f66cc73bfcbf9578c4.camel@hahnjo.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 205 bytes --]

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

[-- Attachment #1.2: 0001-Fix-loading-of-custom-ports-extension.patch --]
[-- Type: text/x-patch, Size: 800 bytes --]

From b5f1013ad969b6e4e35b36dc63798375ffbecda3 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <hahnjo@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


[-- Attachment #1.3: 0002-Match-on-correct-argument-in-make-custom-port.patch --]
[-- Type: text/x-patch, Size: 920 bytes --]

From 78c97b8a49ba336516e954c6c62e4baa7f429f47 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <hahnjo@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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2023-10-29  9:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  9:51 Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library [this message]
2023-11-28 21:01 ` [PATCH] Fixes for custom-ports Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2024-01-04 10:36   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2023-11-28 21:11 ` Jean Abou Samra
2023-11-29  6:47   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2023-11-29  6:54     ` Jean Abou Samra
2023-11-29  7:26       ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2024-01-29 13:46 ` Ludovic Courtès
2024-01-29 21:34   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2024-02-09  4:47   ` Maxim Cournoyer
2024-02-10 10:08     ` Ludovic Courtès
2024-02-11 16:41       ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=441968d3aa118c66ddc376f66cc73bfcbf9578c4.camel@hahnjo.de \
    --to=guile-devel@gnu.org \
    --cc=hahnjo@hahnjo.de \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).