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 v8 02/16] Use R7RS 'rename' syntax for exports. Date: Wed, 6 Dec 2023 18:14:58 -0500 Message-ID: <20231206231512.6505-3-maxim.cournoyer@gmail.com> References: <20231206231512.6505-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="40708"; 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 Thu Dec 07 00:17:27 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 1rB18v-000AIU-7U for guile-devel@m.gmane-mx.org; Thu, 07 Dec 2023 00:17:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rB17O-0001tS-Cf; Wed, 06 Dec 2023 18:15:50 -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 1rB174-0001mW-Uh for guile-devel@gnu.org; Wed, 06 Dec 2023 18:15:32 -0500 Original-Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rB170-00016f-Mv for guile-devel@gnu.org; Wed, 06 Dec 2023 18:15:29 -0500 Original-Received: by mail-qk1-x72c.google.com with SMTP id af79cd13be357-77f3159d822so2970885a.2 for ; Wed, 06 Dec 2023 15:15:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701904525; x=1702509325; 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=ibIeakOyoW9WUpOVeWbl0DWi5SGIqPixqBfktVDVyUFZX/E+dxeGhbH29Qenx0q2Aq HozO36SE7npSI8xqL4nRrwhIGDWWTXX8unnmvzimEgwNDSWRkBgWz2UPp+e2rT18RNFt nW1G/r4dYRDGlURsNfbkss2mOUH+8qeTTZSdkuFwVU+HygrosF7NpX6tt4ISM6Ll9SJ4 4812trW4DalCUyXIBXbD0VumcWMl7kNuvWxvcsIbXKEQC+g7LilIGRUlCy/tvC7J+6/O DAZ0N4DpqpDSeSvj+QAbs7lKcQAbg1KZPi+LyyOtnYlMufRssmah5DAySKW01MVuGc74 POdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701904525; x=1702509325; 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=t5l1BdjWlUAhSIWFEJPdnYRqmWnqJlVx4SiqhJEKikoG0g3hID8YTGQpZ6T9D8tfqo RlpWnV9aI44Nu0C8JEMqBq4hUbN2vtViLcmrk0tnj5LhSd9a1GRtZDhgljbbATYVcnTp VF05yPb+EX+zXIpJL4355jRYgG3jbe9ozIRXcCkz6oGSgDls1DstfSTQ4EnkW8dlJAA/ t+PJXNfoWjlVFd5DDPPyYdkbxOHgisWEIGr0Ef+E+CJz/OyJRAYCgTJTo0iCA4jD8+Zf 19qLu8T5BpTOSSfhhSbHsud2LXflsUAP9rTEaUOWudzxL2/9xsDt0CM+e3raIR65PNLW YOGA== X-Gm-Message-State: AOJu0Yxk16jWXiSyFTbvvJHSjta5TB4T/vZNeLsnrwBYSOZL/F9Egsbp j/EgKSm/Mz58jLKBDFNAcASnqkifwfA= X-Google-Smtp-Source: AGHT+IHiNEPyI21BDhM+oZisA+QwBM/tgrlAqsaEn2lKZ8hhB8y5m/KJGsLjAOpwE0LypVhDI0SzhA== X-Received: by 2002:a05:620a:6789:b0:77d:6826:6404 with SMTP id rr9-20020a05620a678900b0077d68266404mr230323qkn.16.1701904525045; Wed, 06 Dec 2023 15:15:25 -0800 (PST) Original-Received: from localhost.localdomain (dsl-10-130-68.b2b2c.ca. [72.10.130.68]) by smtp.gmail.com with ESMTPSA id re18-20020a05620a8e1200b0077d8ad77069sm3400qkn.26.2023.12.06.15.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 15:15:24 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231206231512.6505-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72c.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:22220 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