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 v6 02/16] Use R7RS 'rename' syntax for exports. Date: Sat, 2 Dec 2023 20:37:03 -0500 Message-ID: <20231203014115.26985-3-maxim.cournoyer@gmail.com> References: <20231203014115.26985-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="29029"; 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 Sun Dec 03 02:42:33 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 1r9bVA-0007Gr-V5 for guile-devel@m.gmane-mx.org; Sun, 03 Dec 2023 02:42:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r9bUB-0001KR-DC; Sat, 02 Dec 2023 20:41:31 -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 1r9bU9-0001Jn-4K for guile-devel@gnu.org; Sat, 02 Dec 2023 20:41:29 -0500 Original-Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r9bU6-0001W2-Jw for guile-devel@gnu.org; Sat, 02 Dec 2023 20:41:28 -0500 Original-Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-423db8ab6e0so19463191cf.1 for ; Sat, 02 Dec 2023 17:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701567685; x=1702172485; 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=aDx/nY98Ptj/xS8/Yo8bGIfD9vhBPlQfqohgVEq/8nq0dbtXKVVtofRthxPaDPZaeD Td1PtbLZjAILFslCgvZdX+bwfC0HxVloeE9Ef1dv7LNVTyZe1ORExjivcBLzA+tW7E7C nhBrPOKC0JcnDUTd2vKLnptYFYnzkSge4VuC/1NG5sNrgkv5XHMcYnzwDlql4zeP6yLo LDx/bpNEXYgsJHoeev1lsmkJ1z6JLSMDvJLLidz8OHx4CXixKsQ7VbfsWFztQAafWZOE vopY26/H4cSS/JS71mCxyzg2h9+beYr4dTzzJcBG48o3hoI/GQ4myGMrvw3SMQ86E0nw U8eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701567685; x=1702172485; 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=LLG7jXUghcSrBrt9sU+GnuIsUITMJC5gw1igK7tPP7kONj45QjpNHzwjibXEPoCWRx EJ309XWvYRZRl2p/3yJh/k/lTQBQtgUZ9nYBflrCIsvYucE5vKON8swRyjsoACfv4Pzt FMisbltyt1u9KUG4hBB8KLHpvle49dIqF4GipcNrAcXu9expYBkmyiDOTYfbt+ityoE+ faCDWxwBLdilZ9NcDTA6M5OLNtgbo/EcKYyM8+579inlIDUt6NPMjEGXthosoRFi8ZzB orSCS6q8vU11Z/XHrEinYyL6cMQLiLLcxOgcMCfajn6byxXgeKPqvTJfa7JhZj4NxSJh RUjw== X-Gm-Message-State: AOJu0YxeQ//epNI6nyfhw8A0gn2PIp3m7MsO/CT827ibnXobsNrH5XYf oVq+nFaUR2QyT9/MmrDzpAgA6Wo392o= X-Google-Smtp-Source: AGHT+IFDzQ5Vh01yWotDIm4MSipCFnin08vk3BqOeKdg/Szde/BU1zwAddZHnAZsq7CfN7kj1/7iWA== X-Received: by 2002:a05:620a:19a7:b0:77e:fba3:a78c with SMTP id bm39-20020a05620a19a700b0077efba3a78cmr1015542qkb.106.1701567685102; Sat, 02 Dec 2023 17:41:25 -0800 (PST) Original-Received: from localhost.localdomain (dsl-10-141-196.b2b2c.ca. [72.10.141.196]) by smtp.gmail.com with ESMTPSA id t15-20020a05620a450f00b0077dca8ed9a4sm2869664qkp.133.2023.12.02.17.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Dec 2023 17:41:24 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231203014115.26985-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x833.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:22162 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