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.devel Subject: [PATCH v9 02/18] Use R7RS 'rename' syntax for exports. Date: Tue, 12 Dec 2023 23:37:41 -0500 Message-ID: <20231213044217.14093-3-maxim.cournoyer@gmail.com> References: <20231213044217.14093-1-maxim.cournoyer@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="22134"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Timothy Sample , Maxim Cournoyer To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Dec 13 05:43:05 2023 Return-path: Envelope-to: guile-devel@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 1rDH5M-0005bL-VX for guile-devel@m.gmane-mx.org; Wed, 13 Dec 2023 05:43:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDH4o-0004Gx-Pr; Tue, 12 Dec 2023 23:42:30 -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 1rDH4n-0004GS-A1 for guile-devel@gnu.org; Tue, 12 Dec 2023 23:42:29 -0500 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDH4k-0006yk-MT for guile-devel@gnu.org; Tue, 12 Dec 2023 23:42:29 -0500 Original-Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-42542b1ed5dso49846411cf.1 for ; Tue, 12 Dec 2023 20:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702442545; x=1703047345; darn=gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/0FSsZF/uM6wQvIGAgJTj+XJSRr1nfMOWljcL1fywDY=; b=Kqc0sGdufDCtI1JjKuTiidjWsUSMREgs8yDqUTiZ2C/TrtUGSfM/19MMizecdquUVi j6vO4X5jyk2lS+oKUPxaS2RDc+6AmYX5EYA26byO6NbN7Lc9hkjxhd96EMRulket0xrQ 2qy7iVjCJmy4kaykgXbChbbYuSs3pAgOPYrVYb0M/ZHKboJGWQkKZ+lmTvOrihVRsmQm JUy5FI6rXpz5Fw4ZGtJqLhWJfzF3AtdHYQBL61sa0nOdMzCb9R8E1ZQ4c65av68pc9/C y7OWrvjH2LizT3UR50uRghE7wQ1ym0d1srQBskx7l8FCO9w2V9b/pwkxRWa3j4D8awFV Jgqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702442545; x=1703047345; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/0FSsZF/uM6wQvIGAgJTj+XJSRr1nfMOWljcL1fywDY=; b=KLl/jiK6uDv+5QXulzNMk2RWDTbcJaLKe7XIZvMikJ1r3Ab7mVAoaZrtoHm3ILjnNa 07/TTL26nYQhWw8aDLl51K9IpaFOYPCivucHjbQp/GJy74N2ditJ8b1oYCzqeMYWlDrA FD8iLIOs0fQ90gjdlyLkHvMfgjTrp9VjFfpf4K5eC+EWqyhXifMu4k1hyJBmrs3QK2qz UbaAsm2qKB6CSU637BBRNyGmADU3z+Fsx7NVjpf5Tqb4RoPX+5sHWUOy3neHn6xxyPwG 2ECTmkXGTAvfn5g8D/FZ8PIcsF1ybWZIs+yXYkjIGmmJdzLi5mlpKzycjdIw9+nMnEkP rP/g== X-Gm-Message-State: AOJu0YxeihJ3W3vPBd2vfhDf7VVwMB5SGEsdo7EoexvbP85//+jNYpo5 KZwZiLENRsiyJXIZs6ongMe6878w0ASjtw== X-Google-Smtp-Source: AGHT+IGw/jqf5oejjn2AukuH3JH0FBcHU4Fz/Im28VnfKVXaLll5gN0PFu5zoV2w4AOIzH9KTp5BfQ== X-Received: by 2002:ac8:7f50:0:b0:425:f204:9070 with SMTP id g16-20020ac87f50000000b00425f2049070mr221521qtk.91.1702442545392; Tue, 12 Dec 2023 20:42:25 -0800 (PST) Original-Received: from localhost.localdomain (dsl-157-186.b2b2c.ca. [66.158.157.186]) by smtp.gmail.com with ESMTPSA id s7-20020ac87587000000b004181138e0c0sm4621719qtq.31.2023.12.12.20.42.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 20:42:24 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231213044217.14093-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::831; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x831.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22232 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'. * NEWS: Mention bug fix. Fixes: https://bugs.gnu.org/67255 Reported-by: Maxim Cournoyer . Modified-by: Maxim Cournoyer --- (no changes since v5) Changes in v5: - Update NEWS NEWS | 2 ++ module/ice-9/r7rs-libraries.scm | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6676c5715..6284bb127 100644 --- a/NEWS +++ b/NEWS @@ -50,6 +50,8 @@ other operations, given the internal use of those functions. ** Fix 'include' not finding included files when byte compiling Guile () +** R7RS define-library now properly supports 'rename' declarations + () Changes in 3.0.9 (since 3.0.8) 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))))))) -- 2.41.0