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 v5 02/15] Use R7RS 'rename' syntax for exports. Date: Wed, 29 Nov 2023 16:59:30 -0500 Message-ID: <20231129220225.6819-3-maxim.cournoyer@gmail.com> References: <20231129220225.6819-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="11965"; 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 Nov 29 23:03:59 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 1r8Sez-0002mv-AW for guile-devel@m.gmane-mx.org; Wed, 29 Nov 2023 23:03:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8Sdu-000192-FD; Wed, 29 Nov 2023 17:02: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 1r8Sds-00018N-3l for guile-devel@gnu.org; Wed, 29 Nov 2023 17:02:48 -0500 Original-Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8Sdp-0004Bu-UL for guile-devel@gnu.org; Wed, 29 Nov 2023 17:02:47 -0500 Original-Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-1fa25d9cddbso112726fac.1 for ; Wed, 29 Nov 2023 14:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701295363; x=1701900163; 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=rScSYia6lY4DvGUjgnYKIQlwcVSBCMn3d50hSKvZoRg=; b=N2lQlJDMYNxX6rYov+ItGCHB9Z92vCcQvvUPhg1M/gQnK9wMXnm8qxDaleb2hzNw8V Dbi9BKMGGnI+uqtNgGxTUixZcd3ZA3wWc3gPBqBkY+8z4k+WpL7/rQnL+GtJNShUYj6i BKUGWdxOMdx4ASpvyVsJeW3tkdRgM921Madb/k1pbvsQMOvVXPdWW5g5JwV8JqucvrcA R309dGXSYiX0EZ8fTr1OWIHSEYy3rlulV+GcpatRj1W296uW35OmToVMkGK3l5uanqBl +jp772d/T5YMoUZlLQGzf9q7kmD5SLTBp7ZfjjSzfKAaKH/EdECChZYq6XcZ20lNHPw6 3bXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701295363; x=1701900163; 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=rScSYia6lY4DvGUjgnYKIQlwcVSBCMn3d50hSKvZoRg=; b=RmYyjl27jjEzYKJhriua3EzejC1qSgGMSSg1XlOXSHfKSbINFawplqyS04AhZn6vvE am2KFVXdIz4nk4v8N9s63Ua6AzJJbrq2U1MYQEOCSt9JanuZQFKDftyO8SejwvpAvuoV rqEzqFcWEuBiNeFzkrudQVl1RbRmg9Ua2qLWLoP9D54ns+nb09BDlpQkLQTHc2mLV43U rmmML+ZSjrbexwiCXZJejReUL+LWZDQfQeC5FFmredAIiSqx4f1wMjM3bucOZDnofOlT jj4IFa6IftHM0EF50yp4Fqe0OSRFrBFQReYooLU5UhhENX4IhSKY0mA78oeXZTGLwOUu 7h5w== X-Gm-Message-State: AOJu0YwbP8zkIzY11u/97goWzFSAmMXTDAuw7YkS14crEtuGklvSRRKg DOneaQcJ+/x/hScLpNq32zxyItqJKzU= X-Google-Smtp-Source: AGHT+IHLwdSN6GnekPwfvMBAdR4rYL76rYbxUJxQaieZSgs9IQthNJUR5rJLlwkjFs0PXgA7AS4+cA== X-Received: by 2002:a05:6870:4409:b0:1f9:fbcf:24d with SMTP id u9-20020a056870440900b001f9fbcf024dmr20335534oah.34.1701295362865; Wed, 29 Nov 2023 14:02:42 -0800 (PST) Original-Received: from localhost.localdomain (dsl-158-174.b2b2c.ca. [66.158.158.174]) by smtp.gmail.com with ESMTPSA id g15-20020ad4510f000000b0067a2a0b44ddsm4644444qvp.44.2023.11.29.14.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:02:42 -0800 (PST) X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231129220225.6819-1-maxim.cournoyer@gmail.com> Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=maxim.cournoyer@gmail.com; helo=mail-oa1-x34.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:22146 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 --- 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