From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.bugs Subject: bug#67255: [PATCH v2] Use R7RS 'rename' syntax for exports. Date: Fri, 24 Nov 2023 16:01:39 -0500 Message-ID: <20231124210150.3428-1-maxim.cournoyer@gmail.com> References: <87r0knbome.fsf@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38077"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Timothy Sample , Maxim Cournoyer To: 67255@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri Nov 24 22:03:11 2023 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r6dKR-0009gr-Fi for guile-bugs@m.gmane-mx.org; Fri, 24 Nov 2023 22:03:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6dKH-0008Sy-RH; Fri, 24 Nov 2023 16:03:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6dKD-0008ST-Rz for bug-guile@gnu.org; Fri, 24 Nov 2023 16:02:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r6dKD-0005he-K7 for bug-guile@gnu.org; Fri, 24 Nov 2023 16:02:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6dKH-0005Md-VA for bug-guile@gnu.org; Fri, 24 Nov 2023 16:03:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r0knbome.fsf@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 24 Nov 2023 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67255 X-GNU-PR-Package: guile Original-Received: via spool by 67255-submit@debbugs.gnu.org id=B67255.170085972920533 (code B ref 67255); Fri, 24 Nov 2023 21:03:01 +0000 Original-Received: (at 67255) by debbugs.gnu.org; 24 Nov 2023 21:02:09 +0000 Original-Received: from localhost ([127.0.0.1]:37334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6dJQ-0005L7-PT for submit@debbugs.gnu.org; Fri, 24 Nov 2023 16:02:09 -0500 Original-Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:60651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6dJP-0005Ke-0c for 67255@debbugs.gnu.org; Fri, 24 Nov 2023 16:02:08 -0500 Original-Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-41cbf31da84so11267471cf.0 for <67255@debbugs.gnu.org>; Fri, 24 Nov 2023 13:02:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700859716; x=1701464516; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xxYWfypCvfnbEu9h9Cz6x2qvHaPidKF0+g3h6/1R6WM=; b=bfgUBTl9lkQrBohfHAKqNS9G9Zn5QAtVoCvkLfKniRmPCSjCDVqP7moP3bdX9EqYof 7TCNcqAIQJbazyN/Z1+iVye5I9dwefmhSjxlSRvRa0SCtyHSiWWJ2j+fwtnFhyYB4EAh TB0pLy7VFwEBhrtiLcPfeuXWGW+FIFPXxyvWovMwieO7HrBh+/wHGYUASvJmrQGzZqWe 09f5JBlB3d0oZLXrfp4acQ1MJhOBylf07mpnHpG6erkik4GjvXd9KEBeXfjDsXXanjMV IBI2YxGu7PSWsavSQeLT08SuAUzGUiYpfCN9fRfdmZ/hLrMuZpK7ch33sfYOXvUH1FQT O9zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700859716; x=1701464516; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xxYWfypCvfnbEu9h9Cz6x2qvHaPidKF0+g3h6/1R6WM=; b=DeIBJGlk5jZkGWZo0UEkPC+L8W+UQrJgjIqoPyxrpCoy/obwk4ehhWcW/JAIw/sMuk nYSoPRsr2vnvc7fiqEure6ZhUaCKNUWgxE6lf7L7dkh9qYgbhUJt950DoORbD80X8N6z 3yHCNxbuxEAynC2Qftg4ewKEUR20WvUXamINW9c9hJJ5DC6l5eKtzoynTL0Efss6L3Zm 2SB0YGzOeQrT60T+1fwGEo5psARXG4dVq1ZTTKLvhFlrkM60/IQCpuxi2AAXGm5FTxPC jHWOe26f6aQ+hDm6GDeyPLAL1tpwtpIwPDOOTNI5h+9rOMK9nK1TVlh9/HmLfWd/+moL yg5A== X-Gm-Message-State: AOJu0Yy1FKGGCyuvhMzi6T39pbb/SGutWD+XO1OhbaTa4nTKBQY6Z3fQ 60ZYCe4FSb2z12j1glUKSIrmYzRn/MA= X-Google-Smtp-Source: AGHT+IGNlHeArypybJvsfX7rZ3c05jVFAxGTIvBvajN9I20nRb2mg8dzcDj+INBRyyFq9wXAVXyeMQ== X-Received: by 2002:a05:622a:1aa2:b0:418:bdf:f4b with SMTP id s34-20020a05622a1aa200b004180bdf0f4bmr5261716qtc.6.1700859716031; Fri, 24 Nov 2023 13:01:56 -0800 (PST) Original-Received: from localhost.localdomain (dsl-158-42.b2b2c.ca. [66.158.158.42]) by smtp.gmail.com with ESMTPSA id g26-20020ac870da000000b004166ab2e509sm1516318qtp.92.2023.11.24.13.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 13:01:55 -0800 (PST) X-Mailer: git-send-email 2.41.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10720 Archived-At: From: Timothy Sample * module/ice-9/r7rs-libraries.scm (define-library): Convert R7RS exports to R6RS exports before passing them on to 'library'. Fixes: https://bugs.gnu.org/67255 Reported-by: Maxim Cournoyer . Modified-by: Maxim Cournoyer --- Changes in v2: - Improve pattern variable names module/ice-9/r7rs-libraries.scm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/ice-9/r7rs-libraries.scm b/module/ice-9/r7rs-libraries.scm index 63a300a26..429d82ad9 100644 --- a/module/ice-9/r7rs-libraries.scm +++ b/module/ice-9/r7rs-libraries.scm @@ -1,5 +1,5 @@ ;; R7RS library support -;; Copyright (C) 2020, 2021 Free Software Foundation, Inc. +;; Copyright (C) 2020, 2021, 2023 Free Software Foundation, Inc. ;; ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -97,12 +97,18 @@ ((decl ...) (partition-decls #'(decl ... . decls) exports imports code)))))) + (define (r7rs-export->r6rs-export export-spec) + (syntax-case export-spec (rename) + ((rename from-identifier to-identifier) + #'(rename (from-identifier to-identifier))) + (identifier #'identifier))) + (syntax-case stx () ((_ name decl ...) (call-with-values (lambda () (partition-decls #'(decl ...) '() '() '())) (lambda (exports imports code) #`(library name - (export . #,exports) + (export . #,(map r7rs-export->r6rs-export exports)) (import . #,imports) . #,code))))))) base-commit: d579848cb5d65440af5afd9c8968628665554c22 -- 2.41.0