From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Dale Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Aug 2020 16:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 43025@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15982855119708 (code B ref -1); Mon, 24 Aug 2020 16:12:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Aug 2020 16:11:51 +0000 Received: from localhost ([127.0.0.1]:59021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAF4Y-0002WW-Tf for submit@debbugs.gnu.org; Mon, 24 Aug 2020 12:11:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:60458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAF4X-0002WP-JO for submit@debbugs.gnu.org; Mon, 24 Aug 2020 12:11:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAF4V-0002Td-Uf for bug-guile@gnu.org; Mon, 24 Aug 2020 12:11:49 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:33945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAF4S-0003Pb-4O for bug-guile@gnu.org; Mon, 24 Aug 2020 12:11:47 -0400 Received: by mail-ot1-x332.google.com with SMTP id k20so3170586otr.1 for ; Mon, 24 Aug 2020 09:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xwnLfRBw6mCCvWEjnsREg80yIU5i+i5n+OWEggvdglo=; b=GWBlC9YOgf8iRFlC8aRvaDYZ/IrZBWFDB5L67eMcIjnxv4ufKS3ktmcZV+0DpjQXpn ix5Bwv1cSPGkysBG1RJaCEn8orATEG5T5a77vd67+7hbjb2yEbdc24xUVFJeQ46W2P1/ 1DUF1aQJVr5IpFwJHEMZQRXTY/7qatxaZ8mkQliA+G/nxeFlHRpaLVm0zKbaVDH+V+NJ yclsxIw0D59w8DTi1DOCXORP0HAMpblsImN/zq8CmaL5N9Vz1H9cEQYebL1kyf930ydq JCXj3ZBudg8ifknsgT8NBqWxFvtA4fiXaFn78FOGlK9dIFB3KhIQ1NA5Qc3NAX3g+7iM xrKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xwnLfRBw6mCCvWEjnsREg80yIU5i+i5n+OWEggvdglo=; b=S30JAREKKP4K+Uxnwv/MgZp7jU2d+RDzKS/nXXUSofQ6zdZrQq/2zSMnIr98cOBgak VsYSTvbajmE78yE8lKuzyDU4PTUdoMLQJOlNTnWFJSD32DjwE8cFk+i6PlQVoFbJMpke ELKbacuicR/delHiGFjsirJAstvwWQbKkvDujY3JmM/E3wUTmXUipQg+9FgmAGuF1e67 +Njjomj+p0em1lTMuo9nEngVjucIHRSHWtiJaqD7px8ildimTVh7Bov2iARpmalG+SJp zzN4RzeGZIU60XFtWIVzSPfD0gE/xv7ErzEx19pq5yuXDvo3NMRQqO/R4TukGFpYPTR3 lcQg== X-Gm-Message-State: AOAM531ty9GbAB0W8780TwYUQW/78V3an1HetDU5B+nJ4W+rDiWrOauV p7LU6wBev0q83nqp175TT28wjty93zgoy8f5E0qKKemavQE= X-Google-Smtp-Source: ABdhPJwDQQy4JHFA9an+oXLzL0u96f4cq65OBSt8j7NnJhuoYBb8sWOaq1hHwNfQkLo+8qcGTqWzavuDbp1wVwLNIo8= X-Received: by 2002:a05:6830:11cc:: with SMTP id v12mr4235990otq.268.1598285497900; Mon, 24 Aug 2020 09:11:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:b288:0:0:0:0:0 with HTTP; Mon, 24 Aug 2020 09:11:37 -0700 (PDT) From: Dale Smith Date: Mon, 24 Aug 2020 12:11:37 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=dalepsmith@gmail.com; helo=mail-ot1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is actually reported by daviid on IRC. This definition of re-export-public-interface works fine on Guile 2.x, fails with Guile 3: (hope this makes it through the mails cleanly) ;;; ;;; re-export-public-interface ;;; (define-module (modules) #:export (re-export-public-interface)) (define-macro (re-export-public-interface . args) "Re-export the public interface of a module or modules. Invoked as @code{(re-export-public-interface (mod1) (mod2)...)}." (if (null? args) '(if #f #f) `(begin ,@(map (lambda (mod) (or (list? mod) (error "Invalid module specification" mod)) `(module-use! (module-public-interface (current-module)) (resolve-interface ',mod))) args)))) ;;; ;;; A module that uses the above ;;; (define-module (a) #:use-module (srfi srfi-1) #:use-module (modules) #:export (map-a)) (eval-when (expand load eval) (re-export-public-interface (srfi srfi-1))) (define (map-a) (map (lambda (item) (display item) (display " ")) (iota 5)) (newline) (values)) ;;; ;;; A 3.0.4 repl session ;;; GNU Guile 3.0.4.3-e076a5 Copyright (C) 1995-2020 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/home/david/alto/projects/g-golf/3.0") scheme@(guile-user)> ,use (a) ;;; note: source file /home/david/alto/projects/g-golf/3.0/a.scm ;;; newer than compiled /home/david/.cache/guile/ccache/3.0-LE-8-4.3/usr/alto/projects/g-golf/3.0/a.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/david/alto/projects/g-golf/3.0/a.scm ;;; compiled /home/david/.cache/guile/ccache/3.0-LE-8-4.3/usr/alto/projects/g-golf/3.0/a.scm.go scheme@(guile-user)> map WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) ;;; : warning: possibly unbound variable `map' WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) ice-9/boot-9.scm:1670:16: In procedure raise-exception: Unbound variable: map Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ;;; ;;; Just to compare, a 2.2.7 session ;;; How to achieve the same using 3.0.4 is the ;;; objective ... Press C-c C-z to bring me back. GNU Guile 2.2.7.2-a5875-dirty Copyright (C) 1995-2019 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/home/david/alto/projects/g-golf/3.0") scheme@(guile-user)> ,use (a) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/david/alto/projects/g-golf/3.0/a.scm ;;; compiling /home/david/alto/projects/g-golf/3.0/modules.scm ;;; compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.A/usr/alto/projects/g-golf/3.0/modules.scm.go ;;; compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.A/usr/alto/projects/g-golf/3.0/a.scm.go scheme@(guile-user)> map $2 = # From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 24 Aug 2020 19:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: dalepsmith@gmail.com, 43025@debbugs.gnu.org X-Debbugs-Original-To: Dale Smith , bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1598298651865 (code B ref -1); Mon, 24 Aug 2020 19:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Aug 2020 19:50:51 +0000 Received: from localhost ([127.0.0.1]:59364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAIUU-0000Dq-Em for submit@debbugs.gnu.org; Mon, 24 Aug 2020 15:50:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:33544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAIUS-0000Dg-2C for submit@debbugs.gnu.org; Mon, 24 Aug 2020 15:50:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAIUR-0008CU-Pr for bug-guile@gnu.org; Mon, 24 Aug 2020 15:50:47 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:39709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAIUN-00025l-9u for bug-guile@gnu.org; Mon, 24 Aug 2020 15:50:46 -0400 Received: from nijino.local (213-147-177-210.hdsl.highway.telekom.at [213.147.177.210]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Bb2mB3Cbyz1LWpP; Mon, 24 Aug 2020 21:50:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4Bb2mB3Cbyz1LWpP DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1598298634; bh=VkEe+Ot5vCUELy95/b3tq3Y6xnzzrOfWYMhL9U8EK74=; h=Subject:From:To:Date:In-Reply-To:References:From; b=odmIxIV1mtujGK1uPbkEufm6OY1JhcF7rCnljfLcdSeM6gzQ5fgehQbqA5JUrG+/Y X9GqfIHKn+LUmYop2oziz7V/4e39y862KfPQF3OYwG5DEc2qCqr5aQrzh8Kmya0YIq qlBA7o5p/LtUUAEvUqyErb7XF2ERcWYrrCGjRSD4= Message-ID: From: Leo Prikler Date: Mon, 24 Aug 2020 21:50:32 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/24 15:50:36 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi Dale. Am Montag, den 24.08.2020, 12:11 -0400 schrieb Dale Smith: > This is actually reported by daviid on IRC. > > This definition of re-export-public-interface works fine on Guile > 2.x, > fails with Guile 3: > (hope this makes it through the mails cleanly) > ;;; > ;;; re-export-public-interface > ;;; > > [...] I'm going to skip the specifics of the macro here, it is not needed for an MWE. > ;;; > ;;; A module that uses the above > ;;; > > > (define-module (a) > #:use-module (srfi srfi-1) > #:use-module (modules) > > #:export (map-a)) > > > (eval-when (expand load eval) > (re-export-public-interface (srfi srfi-1))) > > > (define (map-a) > (map (lambda (item) > (display item) > (display " ")) > (iota 5)) > (newline) > (values)) > For the sake of minimalism, I will shorten this to (define-module (a)) (module-use! (module-public-interface (current-module)) (resolve-interface '(srfi srfi-1))) I hope you don't mind. > [sessions] My solution for this problem would be to build on some of the module "intrinsics", which sadly are not all that well documented. (define-module (a)) (let ((obs (module-obarray (resolve-interface '(srfi srfi-1)))) (iface (module-public-interface (current-module)))) (hash-fold (lambda (key value seed) (module-add! iface key value) seed) *unspecified* obs)) If you want to make this a macro, you really only need to syntax- unquote a module into the (resolve-interface ...) portion of this snippet. Some sessions for reference: GNU Guile 3.0.4 Copyright (C) 1995-2020 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/tmp") scheme@(guile-user)> ,use (a) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/a.scm ;;; compiled $HOME/.cache/guile/ccache/3.0-LE-8-4.3/tmp/a.scm.go scheme@(guile-user)> map WARNING: (guile-user): imported module (a) overrides core binding `map' $1 = # scheme@(guile-user)> ,q GNU Guile 3.0.2 Copyright (C) 1995-2020 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/tmp") scheme@(guile-user)> ,use (a) ;;; note: source file /tmp/a.scm ;;; newer than compiled /home/yuri/.cache/guile/ccache/3.0-LE-8- 4.2/tmp/a.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/a.scm ;;; compiled $HOME/.cache/guile/ccache/3.0-LE-8-4.2/tmp/a.scm.go scheme@(guile-user)> map WARNING: (guile-user): imported module (a) overrides core binding `map' $1 = # scheme@(guile-user)> ,q GNU Guile 2.2.7 Copyright (C) 1995-2019 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/tmp") scheme@(guile-user)> ,use (a) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /tmp/a.scm ;;; compiled $HOME/.cache/guile/ccache/2.2-LE-8-3.A/tmp/a.scm.go scheme@(guile-user)> map $1 = # scheme@(guile-user)> ,q Interestingly, versions newer than 3.0.2 warn about core override in this case, as does #:re-export. If I am not mistaken, this is the way re-export works for variables normally. module-use! on the other hand does not modify the module-obarray, it instead adds the module to a list of uses, which are handled separately in variable lookup during `module_imported_variable`. This C function does look up variables exported by a module, but does not traverse module-uses recursively. I have no idea, how this works for 2.2.7, I only checked the Guile 3 code here. Regards, Leo From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Dale Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 26 Aug 2020 16:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Leo Prikler Cc: 43025@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159846068622007 (code B ref -1); Wed, 26 Aug 2020 16:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Aug 2020 16:51:26 +0000 Received: from localhost ([127.0.0.1]:40625 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAydy-0005it-0T for submit@debbugs.gnu.org; Wed, 26 Aug 2020 12:51:26 -0400 Received: from lists.gnu.org ([209.51.188.17]:41346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAydv-0005il-Mr for submit@debbugs.gnu.org; Wed, 26 Aug 2020 12:51:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAydv-0006tJ-Ev for bug-guile@gnu.org; Wed, 26 Aug 2020 12:51:23 -0400 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]:34996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAydu-0002XM-0c for bug-guile@gnu.org; Wed, 26 Aug 2020 12:51:23 -0400 Received: by mail-oo1-xc35.google.com with SMTP id j19so594124oor.2 for ; Wed, 26 Aug 2020 09:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MWbtMc20ri/72bsvpXIR0A7PAvsuFi8e36jluv3Ie3c=; b=g1KOzhkfBx1pzm4eecdB6uKLwJZyKUehyc2esQYGsgzNSwTxO06Vz7fIyPjZ0gOEdZ EYvIpUkv11/6c1zSwjMhddCvnhjJU8eLBDS0nUUURxuzbxjgxi3rFN0gYJ8JLXiTdsao auuLse5RhtYv8bVMjz2tR2KScaeJKSs/xhSNwpzEiZMrQdEqqM2Syzf7oLvlkISOkIr4 PT8P5v+u5Jfxn3I1/R1M5pIUSJyePdQqiLA7emLeA9qkVdc00XqLgNriXHlR+5l+HH4c KKJPtPYvoOwg+SniFSUUYNXa/y+KIesMxJXaCJwyzL9+8wEg63whu8T2WWOyl2Smiy5H UpWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MWbtMc20ri/72bsvpXIR0A7PAvsuFi8e36jluv3Ie3c=; b=eO8W2g2GwvzATubK9O1K+y5X80CGCKfNNk+JUWbXMLwYf+V+9ly3BS7RsfYDOBn2cD tUh6Q8Rk8KLxvt27wNJ1UzluDcmx1RU9+0NAgEFqzpr2IzK84nA4tniL8PwrSl3BtlMz iqphc5w0WEOgMx5ZqzHyyPp6lNNmC5u4SduASAreHzIv9xYXVc418THz3swetvxSMll9 GH+yq0Nchtvrnqfxx63r/cqogiG2H5UxydM6dJHikyR3pQ6819sHkCTz74PFI61byJuD Lmg/tpjs/3vyY1yFBScrYM0PTKSzxS3BqkOX+ZSmIFkPyLl5JkLHTuewIX4sNLc2Z8TI r7sQ== X-Gm-Message-State: AOAM5311PWyzTb8k9glWvXBdvALBPS6f0MsiFf4K/WGJEm31bJ3lmqKu oB9IJGqLbROoXSUorFjay5WhfPxQFO4Qq4UhEuButNfyEqY= X-Google-Smtp-Source: ABdhPJy/szRLwpoOHErOFTwwFCVAliGy0DUSkBi9UruipwF/bdUj/3WG/PDh9u7bGqnX4MjQh37uU5eqJRzFYi+BXP4= X-Received: by 2002:a4a:9d48:: with SMTP id f8mr1660443ook.50.1598460679765; Wed, 26 Aug 2020 09:51:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:b288:0:0:0:0:0 with HTTP; Wed, 26 Aug 2020 09:51:18 -0700 (PDT) In-Reply-To: References: From: Dale Smith Date: Wed, 26 Aug 2020 12:51:18 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::c35; envelope-from=dalepsmith@gmail.com; helo=mail-oo1-xc35.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 8/24/20, Leo Prikler wrote: > My solution for this problem would be to build on some of the module > "intrinsics", which sadly are not all that well documented. > > (define-module (a)) > > (let ((obs (module-obarray (resolve-interface '(srfi srfi-1)))) > (iface (module-public-interface (current-module)))) > (hash-fold > (lambda (key value seed) > (module-add! iface key value) > seed) > *unspecified* > obs)) > > If you want to make this a macro, you really only need to syntax- > unquote a module into the (resolve-interface ...) portion of this > snippet. So with that in mind, how about something like this (currently no error checking): (define-syntax re-export-public-interface (syntax-rules () ((_ mod ...) (let ((iface (module-public-interface (current-module)))) (module-for-each (lambda (sym val) (module-add! iface sym val) (hashq-set! (module-replacements iface) sym #t)) (resolve-interface 'mod)) ...)))) From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 26 Aug 2020 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Dale Smith Cc: 43025@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159846157823491 (code B ref -1); Wed, 26 Aug 2020 17:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Aug 2020 17:06:18 +0000 Received: from localhost ([127.0.0.1]:40652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAysM-00066p-0L for submit@debbugs.gnu.org; Wed, 26 Aug 2020 13:06:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:50542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAysJ-00066h-IW for submit@debbugs.gnu.org; Wed, 26 Aug 2020 13:06:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAysJ-0003kG-EW for bug-guile@gnu.org; Wed, 26 Aug 2020 13:06:15 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:1254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAysF-0004ow-GR for bug-guile@gnu.org; Wed, 26 Aug 2020 13:06:14 -0400 Received: from nijino.local (213-147-177-210.hdsl.highway.telekom.at [213.147.177.210]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4BcC1Q0HdCz1LXt2; Wed, 26 Aug 2020 19:06:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4BcC1Q0HdCz1LXt2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1598461562; bh=wH9tAW0J6GtpcJ+JfNNf8sx28TUMTiycpsZiE2KC/Zw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=mCp9bMvMd64aDIPzOmT/FrKPbQBRKRxjY2NWI3rKEep+DYAwoL3HFHVF7mIQAaQpk 2jIvkpPygb9Tlk8P9NiApQp2gr2mYM5pcnTthzbaDQY6L0nlB5SdUHRgVFy79F6EC3 +kCkyNXR6FamUfo/RZ6zyh6N9H9vXU4Utuo9w3io= Message-ID: <5120663b69aa5e340de4b7be455d8fe2e9d233e7.camel@student.tugraz.at> From: Leo Prikler Date: Wed, 26 Aug 2020 19:06:00 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 13:06:03 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Am Mittwoch, den 26.08.2020, 12:51 -0400 schrieb Dale Smith: > On 8/24/20, Leo Prikler wrote: > > My solution for this problem would be to build on some of the > > module > > "intrinsics", which sadly are not all that well documented. > > > > (define-module (a)) > > > > (let ((obs (module-obarray (resolve-interface '(srfi srfi-1)))) > > (iface (module-public-interface (current-module)))) > > (hash-fold > > (lambda (key value seed) > > (module-add! iface key value) > > seed) > > *unspecified* > > obs)) > > > > If you want to make this a macro, you really only need to syntax- > > unquote a module into the (resolve-interface ...) portion of this > > snippet. > > So with that in mind, how about something like this (currently no > error checking): > > (define-syntax re-export-public-interface > (syntax-rules () > ((_ mod ...) > (let ((iface (module-public-interface (current-module)))) > (module-for-each > (lambda (sym val) > (module-add! iface sym val) > (hashq-set! (module-replacements iface) sym #t)) > (resolve-interface 'mod)) > ...)))) LGTM, but don't forget to test it ;) Also I'd call it `re-export-public-interface!', or even `re-export-and- replace-interface!' but that's a personal preference. From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Dale Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 27 Aug 2020 02:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Leo Prikler Cc: 43025@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159849487828169 (code B ref -1); Thu, 27 Aug 2020 02:22:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Aug 2020 02:21:18 +0000 Received: from localhost ([127.0.0.1]:41195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kB7XR-0007KH-Qq for submit@debbugs.gnu.org; Wed, 26 Aug 2020 22:21:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:56732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kB7XN-0007K7-LK for submit@debbugs.gnu.org; Wed, 26 Aug 2020 22:21:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kB7XN-0002ff-Fa for bug-guile@gnu.org; Wed, 26 Aug 2020 22:21:13 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]:39122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kB7XH-0003jE-C2 for bug-guile@gnu.org; Wed, 26 Aug 2020 22:21:13 -0400 Received: by mail-ot1-x32e.google.com with SMTP id r8so3216990ota.6 for ; Wed, 26 Aug 2020 19:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/eSpET1ZBCITb7vzc/oQPE4Teb2vJymQcuelSzEOpjQ=; b=jOneO9SUEIxTFGlGVOtk/W+62EYRic/v3GCJjGF2TpaMqWu4fHSOlAOabPFNW1pw4+ 5ImMR6F4okZqeFYd5+i6x8aFbH/6QgF33HTfJWOwbJmlo0xxzNLFwbLRZtP5RilJBgxr bGRBoDlSR1ab4a/SPP0KXxu5JE/90deJ12JQT8uVtzCiDjkEh7pz7r1CyCf1zTdJumvy mQBoez6DMwri/IxtIEaUlJT+jAalgih7AsMD6kTmhwiJ3AWZbxsY1gwT2WjDtR81gu2W fSM71YT5m8XC0xojyA0JU0KfEPtjBFGJ4o+CxA8RP1Y0Wi8IuTdSi2n2WUK9ppTL6ZmW ZIyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/eSpET1ZBCITb7vzc/oQPE4Teb2vJymQcuelSzEOpjQ=; b=FgfjNvRZ3bSBNXjlusv7pwVNcG2GmQQJIZaA0sjoq3FmBMwwY2ye+gOpGy5qnGMfza t6wiWgz2PIDh7WCGL0qqvgNJjUeq2vPcaZlwLjzrE8vplaRRkTSF40Pu1FTLb14cJZA0 dOw8yS3kOMhRwqvLcBfEeD1Gv8eaNccNvK5UiVd/SXRe497EANDLTz4QeC0KAMlYMocv 1qWdwIf41FcgUuEcmShG9hRv2zuWnOmk+15jG/lXeM4KkQ5COMc/i+clc80gEbnTm5eb IRKle3K0DB7P3WfZRon1OBuAJFcWdP+mmcGbmCKF6P0fJw70w84kE0idGn0CSxpJfGO9 EKiw== X-Gm-Message-State: AOAM531b3QAUIFPMCBtzvn4oCdSrZ+PGbimGy8l5kkkc0lSEcBXeBH5G RTC2lpbPiqqauPZoEx+Twxegibwnf0n84zianZPC3O2LiWU= X-Google-Smtp-Source: ABdhPJzfzqwkAU3Et05uH+ST/1Eziq/ZFHruNvovTjKkBR9FcSp4U7x4oJaNYyityUawpncvr52+fdcDrhWGPNckKvQ= X-Received: by 2002:a9d:6204:: with SMTP id g4mr6302283otj.268.1598494865801; Wed, 26 Aug 2020 19:21:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:b288:0:0:0:0:0 with HTTP; Wed, 26 Aug 2020 19:21:04 -0700 (PDT) In-Reply-To: References: From: Dale Smith Date: Wed, 26 Aug 2020 22:21:04 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=dalepsmith@gmail.com; helo=mail-ot1-x32e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This seems to work for guile-2.2 and guile-3. Would be nice if it checked that module names look like lists. One step closer to g-golf working on guile-3! (define-syntax re-export-public-interface (syntax-rules () "Re-export the public interface of a module or modules. Invoked as @code{(re-export-public-interface (mod1) (mod2) ...)}." ((_ mod mods ...) (let ((iface (module-public-interface (current-module)))) (define (r-e-p-i module) (cond-expand (guile-3 (module-for-each (lambda (sym val) (hashq-set! (module-replacements iface) sym #t) (module-add! iface sym val)) (resolve-interface module))) (else (module-use! iface (resolve-interface module))))) (r-e-p-i 'mod) (r-e-p-i 'mods) ...)))) From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Dale Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 28 Aug 2020 00:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Leo Prikler Cc: 43025@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159857356125762 (code B ref -1); Fri, 28 Aug 2020 00:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Aug 2020 00:12:41 +0000 Received: from localhost ([127.0.0.1]:44519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBS0X-0006hR-2Q for submit@debbugs.gnu.org; Thu, 27 Aug 2020 20:12:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:60098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBS0W-0006hK-0N for submit@debbugs.gnu.org; Thu, 27 Aug 2020 20:12:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBS0V-0003rS-R3 for bug-guile@gnu.org; Thu, 27 Aug 2020 20:12:39 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]:44892) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBS0U-0000wU-9Q for bug-guile@gnu.org; Thu, 27 Aug 2020 20:12:39 -0400 Received: by mail-oi1-x230.google.com with SMTP id h3so6234936oie.11 for ; Thu, 27 Aug 2020 17:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XkOQrgWr1BcN1uCsTk6b0HtbZI+0wHbfID2K1j51nEk=; b=HCdMLzJJw1jzJgfI/3cCwTwje43oE+n5bVAeWkelf54LejqK9wO3oYcQ6IMXOoNQ8e F6QLtNioC30xuTKTEyjxv69c+kX0guGA1trMk4Tyca6/6rSKrDmEkl/qcrMj0emvJANe i1P27Y8h1tjO6f/1E0Br/RnNE4aCYRafFFxv3Z9ueUZ3ZC3jZCvCwuEohEV7wIma3I9d h8nP1KK7s7LyA+Ce/s5D2gphE2+lFmnLIkk7zpuVLq2Ab3bk1noIK/SB5RXUgFzNZNdB n4ZRzPzg5QozToC+A/NPq+gb91hTxR3BsNPvr3CNTh/cHOj8PERd3KJ6LktAOAtBYQUZ v1KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XkOQrgWr1BcN1uCsTk6b0HtbZI+0wHbfID2K1j51nEk=; b=BkRjtALI81NVtCicYfKyo7MIqVEY4Rq9L9OKSkWhzELyj4zQE8dVnlB4C9rZrEvhnr zQgYNzglGZn4ApiurKaUs0AhA6VkrqxaF/yAZcGoyRh4CCLKzUApf5jMFTcLTpKsZTO0 019DOLTsuxi+t/ciymgzFIXtL0eKiVEA4yxO/SzLkfUCJzK0GA89c4CCkkUdMrXJU+BT MblY2WXvNbw4v6y1vn9o7Ug1s67/5+KAUGKPqWL1SVTtxvCcX8TXX0SEj36rcVZPTGFC BjEzlX8+B53jUhPN0jJYCtdqEkWicmh6lVc3tV0HOc1qylbVkTHRGAzU9q0J5J/OqgAO bBIg== X-Gm-Message-State: AOAM532sZK2+Fz8+bKyxVemW1W3iAMbh2j3qKdlLRr0wL5RH0PgIY6RT NwYnRKkoPiD8tGUDWx35+b0FIdNvvmb1CHwXolyDYC5t1dg= X-Google-Smtp-Source: ABdhPJwqrt8oYRRF8WDc2JhzKkWJI7NSyy2dE2zHLHdgQU8zV2U/podfFomdzunIZMtlJhu43xumvh+l4ahD50cXy8s= X-Received: by 2002:aca:916:: with SMTP id 22mr79351oij.134.1598573556386; Thu, 27 Aug 2020 17:12:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:b288:0:0:0:0:0 with HTTP; Thu, 27 Aug 2020 17:12:35 -0700 (PDT) In-Reply-To: References: From: Dale Smith Date: Thu, 27 Aug 2020 20:12:35 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=dalepsmith@gmail.com; helo=mail-oi1-x230.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) And here has some better error handling/reporting. (define-syntax re-export-public-interface (syntax-rules () "Re-export the public interface of a module or modules. Invoked as @code{(re-export-public-interface (mod1) (mod2) ...)}." ((_ (m0 m0* ...) (mn mn* ...) ...) (let ((iface (module-public-interface (current-module)))) (define (r-e-p-i module) (cond-expand (guile-3 (module-for-each (lambda (sym val) (hashq-set! (module-replacements iface) sym #t) (module-add! iface sym val)) (resolve-interface module))) (else (module-use! iface (resolve-interface module))))) (r-e-p-i '(m0 m0* ...)) (r-e-p-i '(mn mn* ...)) ...)) ((_) (syntax-violation 're-export-public-interface "must provide one or more module names" '(re-export-public-interface))) ((_ m m* ...) (syntax-violation 're-export-public-interface "module names must look like lists" '(re-export-public-interface m m* ...))))) From unknown Sat Sep 13 20:35:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43025: re-export-public-interface fails on Guile 3 Resent-From: Dale Smith Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 28 Aug 2020 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43025 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Leo Prikler Cc: 43025@debbugs.gnu.org X-Debbugs-Original-Cc: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.159864254424967 (code B ref -1); Fri, 28 Aug 2020 19:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Aug 2020 19:22:24 +0000 Received: from localhost ([127.0.0.1]:47444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBjxA-0006Ud-6U for submit@debbugs.gnu.org; Fri, 28 Aug 2020 15:22:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:48004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kBjx8-0006UV-G0 for submit@debbugs.gnu.org; Fri, 28 Aug 2020 15:22:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kBjx8-0005JQ-0F for bug-guile@gnu.org; Fri, 28 Aug 2020 15:22:22 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]:39103) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kBjx5-0003tP-A3 for bug-guile@gnu.org; Fri, 28 Aug 2020 15:22:21 -0400 Received: by mail-ot1-x336.google.com with SMTP id r8so166344ota.6 for ; Fri, 28 Aug 2020 12:22:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=q1Xyt7WGi0xwX6gXPnZK8GgBX4LmVYMX7GieU7tXjQA=; b=h0B3IohzbTv5/5gzF/ttpCXeRRaiA0d0ldVS8TGIUVsMxr2VJaKHIso2SSTv4BspI0 y87/5JPxMr+AMk61CEll846w9ruvU2wakt3DflmtX18w11NM1FG8B15JyQ1o/D+KHFyy ZJte5Kk8BSKSj9Czwubj3saoPto6h7zk8getsB3bKDVdMR69pHg4AhGDF1ZQECoZ6kOt 9gVNMo/qsOcX7NUrXavjaenDrjoAjSAIMHiltsn73BpUGHGLjtnG8V8K7Dp/5tk7UeyD JnRu5uhsdj36R6pbAzxLg3c2qG2UUaC81ti7JPbU4akh6ybE9LPBy3W5pUVysnOUfGo7 RRng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=q1Xyt7WGi0xwX6gXPnZK8GgBX4LmVYMX7GieU7tXjQA=; b=JzyxrlvxlS1Z0bapmYAt84t3lUxFv+K/zjJC5mePuOAra6xboxASf3DkjxSVmfx5sQ CIrakLyA2bUANU7qNFgIx/gLnnoUoZLzTUX3YnFAh5Ei4+p7IYKFyG6QNWKgH0UfOCBt 6PB68BKb2xHXd6T+1fso03+5kzLAxFCJZeMljcmSGrvCgy2TiseLuYFUAvHpACAt+sfO +xO2B5h4AHf6qcX21kLYFae2I0xMueY4h6WcRJZEegUDPqIPoLyM5Q+6NDTbZ4foYzOR NY1WuPvkkLobhP9LN3X79tMuiGh+Ezs7jr+sz2z8xMn/pE794twSndn8wKqUdjBUXeA8 PArg== X-Gm-Message-State: AOAM530dhbyEyf8tL73pPfl1ugcDmWQ30fVGWXSBxuyqx5z6XuQaxigT 2yvYQ9QB9LysU11wHnagzezs/ToW35E41D4+2/B5GYY3s1I= X-Google-Smtp-Source: ABdhPJyq+Z3LgMq3aTJW49MY/awQKyannO/GU8b5WEF1DtCTzEkV5neAWDrxl6jISUTv66gVbEYq0ybtxJpXxQDewks= X-Received: by 2002:a9d:2ac5:: with SMTP id e63mr111215otb.119.1598642537660; Fri, 28 Aug 2020 12:22:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:b288:0:0:0:0:0 with HTTP; Fri, 28 Aug 2020 12:22:17 -0700 (PDT) In-Reply-To: References: From: Dale Smith Date: Fri, 28 Aug 2020 15:22:17 -0400 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::336; envelope-from=dalepsmith@gmail.com; helo=mail-ot1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) And now using a more standard error reporting function. I think it's done now. (define-syntax re-export-public-interface (syntax-rules () "Re-export the public interface of a module or modules. Invoked as @code{(re-export-public-interface (mod1) (mod2) ...)}." ((_ (m0 m0* ...) (mn mn* ...) ...) (let ((iface (module-public-interface (current-module)))) (define (r-e-p-i module) (cond-expand (guile-3 (module-for-each (lambda (sym val) (hashq-set! (module-replacements iface) sym #t) (module-add! iface sym val)) (resolve-interface module))) (else (module-use! iface (resolve-interface module))))) (r-e-p-i '(m0 m0* ...)) (r-e-p-i '(mn mn* ...)) ...)) ((_) (syntax-error "must provide one or more module names")) ((_ m m* ...) (syntax-error "module names must look like lists")))) From unknown Sat Sep 13 20:35:53 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dale Smith Subject: bug#43025: closed (re-export-public-interface fails on Guile 3) Message-ID: References: X-Gnu-PR-Message: they-closed 43025 X-Gnu-PR-Package: guile Reply-To: 43025@debbugs.gnu.org Date: Fri, 12 Mar 2021 14:13:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1615558381-1247-1" This is a multi-part message in MIME format... ------------=_1615558381-1247-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #43025: re-export-public-interface fails on Guile 3 which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 43025@debbugs.gnu.org. --=20 43025: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43025 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1615558381-1247-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 43025-close) by debbugs.gnu.org; 12 Mar 2021 14:13:00 +0000 Received: from localhost ([127.0.0.1]:56330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKiXE-0000Jt-0E for submit@debbugs.gnu.org; Fri, 12 Mar 2021 09:13:00 -0500 Received: from mail-ot1-f41.google.com ([209.85.210.41]:39395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKiXB-0000Jg-Vi for 43025-close@debbugs.gnu.org; Fri, 12 Mar 2021 09:12:59 -0500 Received: by mail-ot1-f41.google.com with SMTP id x28so3577015otr.6 for <43025-close@debbugs.gnu.org>; Fri, 12 Mar 2021 06:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hHYE6Sf/1WtIQbiuqsYT+YvRHJGGTWUprZ8Bqz0Ykcg=; b=M7XHlCvF7f283kWNcMtaq3VPnqP2tAXupy/rQad2iVzP1cinL9EqnQbFTV141YKmYz maSf0lqoFsh8n12RiR0NYsOEW7w5ZfjxwuZ1L8TeXCsZbaFqAWPYU2NuJ5ex8kWSGy0o 8TegtNGabXDpIoJccaU4qGM5igMt1j1TXf+z+TdhdDUHZHkt0wWeLS08OxnoHBfCampy OVKSMf4J6JOVuGrAiYeMGUoi7fnO+Y+AMu3AXJI32R3mdC1fClRqIT/B874nh7lYnThY 3DGLvqaLD2xNXfMWoDhe92d2iiJex4PoyC7HuJiond+cDspm05FTHuX8sQEPTKHq2BCb CDmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hHYE6Sf/1WtIQbiuqsYT+YvRHJGGTWUprZ8Bqz0Ykcg=; b=pXY0x6DgngZ6E5ZdEWoKLS/VmHChl8pTuwkRv/mSqhnu7PvzjTqdXZKAmZQd58AjZ5 UjakIqkIi1URKu77pPIMZRB4zQ0oidEqfR0ZabVVJQLUo84uHuW8RIYFflSznjXOqoJJ lqOQNDgQhi8W5cIXIlE+wP0XJfuz/NmXEtg5EFOGKi3JC2JUGvnQfkgUYnikpmGxRFxl fLvKz+ldgpu7L6nvVoEOzvu3xiJ4F7zrOze4k3yHUDGkAt8+7snRNB8C5CUaq6kHHccA F5ba4fb/zuyPCPrlPgM3n4vIv82GZvjqjNIhbEBaKuKCoXvJWh2ZIDnEf1A/YF+vDoLn j53w== X-Gm-Message-State: AOAM531Pxi4XOmSJA/9JaJAhbKG/kYVcI/CYZiTf0vrTnrZkVYrIDHKe zaW8BmwQo0EN77OanitO24N3QMxDkzBE+m1viJkek5Hi X-Google-Smtp-Source: ABdhPJzktt8edBlmfpZJ1cQSAGQ36JvBdslwKQtwFFG+1ffPcTels9c+1xlZuClJKizr9g6+BcSPLCxTsrxvNjhz3iI= X-Received: by 2002:a05:6830:4d:: with SMTP id d13mr3448356otp.295.1615558372188; Fri, 12 Mar 2021 06:12:52 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a4a:9667:0:0:0:0:0 with HTTP; Fri, 12 Mar 2021 06:12:51 -0800 (PST) From: Dale Smith Date: Fri, 12 Mar 2021 09:12:51 -0500 Message-ID: Subject: re-export-public-interface fails on Guile 3 To: 43025-close@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43025-close X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Closing this. Please see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47084 instead for a better/more accurate report. -Dale ------------=_1615558381-1247-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Aug 2020 16:11:51 +0000 Received: from localhost ([127.0.0.1]:59021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAF4Y-0002WW-Tf for submit@debbugs.gnu.org; Mon, 24 Aug 2020 12:11:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:60458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAF4X-0002WP-JO for submit@debbugs.gnu.org; Mon, 24 Aug 2020 12:11:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAF4V-0002Td-Uf for bug-guile@gnu.org; Mon, 24 Aug 2020 12:11:49 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:33945) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAF4S-0003Pb-4O for bug-guile@gnu.org; Mon, 24 Aug 2020 12:11:47 -0400 Received: by mail-ot1-x332.google.com with SMTP id k20so3170586otr.1 for ; Mon, 24 Aug 2020 09:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xwnLfRBw6mCCvWEjnsREg80yIU5i+i5n+OWEggvdglo=; b=GWBlC9YOgf8iRFlC8aRvaDYZ/IrZBWFDB5L67eMcIjnxv4ufKS3ktmcZV+0DpjQXpn ix5Bwv1cSPGkysBG1RJaCEn8orATEG5T5a77vd67+7hbjb2yEbdc24xUVFJeQ46W2P1/ 1DUF1aQJVr5IpFwJHEMZQRXTY/7qatxaZ8mkQliA+G/nxeFlHRpaLVm0zKbaVDH+V+NJ yclsxIw0D59w8DTi1DOCXORP0HAMpblsImN/zq8CmaL5N9Vz1H9cEQYebL1kyf930ydq JCXj3ZBudg8ifknsgT8NBqWxFvtA4fiXaFn78FOGlK9dIFB3KhIQ1NA5Qc3NAX3g+7iM xrKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xwnLfRBw6mCCvWEjnsREg80yIU5i+i5n+OWEggvdglo=; b=S30JAREKKP4K+Uxnwv/MgZp7jU2d+RDzKS/nXXUSofQ6zdZrQq/2zSMnIr98cOBgak VsYSTvbajmE78yE8lKuzyDU4PTUdoMLQJOlNTnWFJSD32DjwE8cFk+i6PlQVoFbJMpke ELKbacuicR/delHiGFjsirJAstvwWQbKkvDujY3JmM/E3wUTmXUipQg+9FgmAGuF1e67 +Njjomj+p0em1lTMuo9nEngVjucIHRSHWtiJaqD7px8ildimTVh7Bov2iARpmalG+SJp zzN4RzeGZIU60XFtWIVzSPfD0gE/xv7ErzEx19pq5yuXDvo3NMRQqO/R4TukGFpYPTR3 lcQg== X-Gm-Message-State: AOAM531ty9GbAB0W8780TwYUQW/78V3an1HetDU5B+nJ4W+rDiWrOauV p7LU6wBev0q83nqp175TT28wjty93zgoy8f5E0qKKemavQE= X-Google-Smtp-Source: ABdhPJwDQQy4JHFA9an+oXLzL0u96f4cq65OBSt8j7NnJhuoYBb8sWOaq1hHwNfQkLo+8qcGTqWzavuDbp1wVwLNIo8= X-Received: by 2002:a05:6830:11cc:: with SMTP id v12mr4235990otq.268.1598285497900; Mon, 24 Aug 2020 09:11:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:b288:0:0:0:0:0 with HTTP; Mon, 24 Aug 2020 09:11:37 -0700 (PDT) From: Dale Smith Date: Mon, 24 Aug 2020 12:11:37 -0400 Message-ID: Subject: re-export-public-interface fails on Guile 3 To: bug-guile@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=dalepsmith@gmail.com; helo=mail-ot1-x332.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is actually reported by daviid on IRC. This definition of re-export-public-interface works fine on Guile 2.x, fails with Guile 3: (hope this makes it through the mails cleanly) ;;; ;;; re-export-public-interface ;;; (define-module (modules) #:export (re-export-public-interface)) (define-macro (re-export-public-interface . args) "Re-export the public interface of a module or modules. Invoked as @code{(re-export-public-interface (mod1) (mod2)...)}." (if (null? args) '(if #f #f) `(begin ,@(map (lambda (mod) (or (list? mod) (error "Invalid module specification" mod)) `(module-use! (module-public-interface (current-module)) (resolve-interface ',mod))) args)))) ;;; ;;; A module that uses the above ;;; (define-module (a) #:use-module (srfi srfi-1) #:use-module (modules) #:export (map-a)) (eval-when (expand load eval) (re-export-public-interface (srfi srfi-1))) (define (map-a) (map (lambda (item) (display item) (display " ")) (iota 5)) (newline) (values)) ;;; ;;; A 3.0.4 repl session ;;; GNU Guile 3.0.4.3-e076a5 Copyright (C) 1995-2020 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/home/david/alto/projects/g-golf/3.0") scheme@(guile-user)> ,use (a) ;;; note: source file /home/david/alto/projects/g-golf/3.0/a.scm ;;; newer than compiled /home/david/.cache/guile/ccache/3.0-LE-8-4.3/usr/alto/projects/g-golf/3.0/a.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/david/alto/projects/g-golf/3.0/a.scm ;;; compiled /home/david/.cache/guile/ccache/3.0-LE-8-4.3/usr/alto/projects/g-golf/3.0/a.scm.go scheme@(guile-user)> map WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) ;;; : warning: possibly unbound variable `map' WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) WARNING: (guile-user): imported module (a) overrides core binding `map' WARNING: (guile-user): `map' imported from both (guile) and (a) ice-9/boot-9.scm:1670:16: In procedure raise-exception: Unbound variable: map Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ;;; ;;; Just to compare, a 2.2.7 session ;;; How to achieve the same using 3.0.4 is the ;;; objective ... Press C-c C-z to bring me back. GNU Guile 2.2.7.2-a5875-dirty Copyright (C) 1995-2019 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (add-to-load-path "/home/david/alto/projects/g-golf/3.0") scheme@(guile-user)> ,use (a) ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /home/david/alto/projects/g-golf/3.0/a.scm ;;; compiling /home/david/alto/projects/g-golf/3.0/modules.scm ;;; compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.A/usr/alto/projects/g-golf/3.0/modules.scm.go ;;; compiled /home/david/.cache/guile/ccache/2.2-LE-8-3.A/usr/alto/projects/g-golf/3.0/a.scm.go scheme@(guile-user)> map $2 = # ------------=_1615558381-1247-1--