From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" Newsgroups: gmane.lisp.guile.bugs Subject: bug#74210: No unbound variable warning when via 'export' Date: Tue, 5 Nov 2024 10:23:20 +0100 Message-ID: <20241105102323.YxPN2D0014tRJL601xPNwn@laurent.telenet-ops.be> References: <20241104214356.Ykjw2D0014tRJL601kjwhV@laurent.telenet-ops.be> <0effbe63-caee-a08b-77e0-576c3fe4b25c@gmail.com> Reply-To: Maxime Devos Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_B6F4771F-98C5-4E8B-A640-CCFB08A42CAC_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14824"; mail-complaints-to="usenet@ciao.gmane.io" To: 74210@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Nov 05 10:24:33 2024 Return-path: Envelope-to: guile-bugs@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 1t8Fnc-0003gN-8f for guile-bugs@m.gmane-mx.org; Tue, 05 Nov 2024 10:24:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8FnE-00082x-6t; Tue, 05 Nov 2024 04:24:08 -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 1t8Fn8-00082W-Pu for bug-guile@gnu.org; Tue, 05 Nov 2024 04:24:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8Fn8-0003s3-Ck for bug-guile@gnu.org; Tue, 05 Nov 2024 04:24:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:Date:From:MIME-Version:To:Subject; bh=yVrcIDMisnBg3Km9jVivb6GVqTGhRx+VQHzhx1EvJwA=; b=hlIH8VBMlbqXo2wvtAOBFfYhu5zIwBra4E83qz7cR8n24ik9bOnw7vkk8bNV6o32jCTLgEaUj6Jw1ebN1Jt6jgpd6ysQMogz5dzXjVYRowCzHHJdCh6zCK0JmLajfP9Cst4Kmc9WBGV0+WKQsWG0o1Mnh/rJF9psNKoeF98CDHRDnezJ/qfogfsZcOCVD9dgpev1039OCzFrUMFj//qe/DjitHv35Tzm7f3Psf/Ho3KtQAZh77pFWTRtZDqfthWUQY4tVTzY41hPAtDUBPHdn6TD0gCDDK0/25tF+Qt4aPnuA9TKrTFKp557KhVyjRlujVqyiS3UR3x2FW1MmvlI2Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8Fn7-0000TB-Vu for bug-guile@gnu.org; Tue, 05 Nov 2024 04:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 05 Nov 2024 09:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74210 X-GNU-PR-Package: guile X-Debbugs-Original-To: "bug-guile@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.17307986131789 (code B ref -1); Tue, 05 Nov 2024 09:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Nov 2024 09:23:33 +0000 Original-Received: from localhost ([127.0.0.1]:43483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8Fmf-0000Sn-0l for submit@debbugs.gnu.org; Tue, 05 Nov 2024 04:23:33 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:56618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8Fmb-0000Sh-PJ for submit@debbugs.gnu.org; Tue, 05 Nov 2024 04:23:32 -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 1t8Fmb-0007u2-Ij for bug-guile@gnu.org; Tue, 05 Nov 2024 04:23:29 -0500 Original-Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8FmY-0003qt-MF for bug-guile@gnu.org; Tue, 05 Nov 2024 04:23:29 -0500 Original-Received: from [IPv6:2a02:1811:8c0e:ef00:28f7:a748:a738:4cef] ([IPv6:2a02:1811:8c0e:ef00:28f7:a748:a738:4cef]) by laurent.telenet-ops.be with cmsmtp id YxPN2D0014tRJL601xPNwn; Tue, 05 Nov 2024 10:23:23 +0100 Importance: normal X-Priority: 3 In-Reply-To: <0effbe63-caee-a08b-77e0-576c3fe4b25c@gmail.com> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r24; t=1730798603; bh=yVrcIDMisnBg3Km9jVivb6GVqTGhRx+VQHzhx1EvJwA=; h=Message-ID:MIME-Version:To:From:Subject:Date:In-Reply-To: References:Content-Type:From; b=bw3FVJFq3DWDwZpjc2ywMIUhgF2+9ocpkWu6VRoRodV6wL3qrHVY4Y6jyGNnqy/vr gbwj6GaiLsJptlG2D7HKaKk9ENkQDjZbR7ypHYEfx+jGBc/LCME28gK6rMWYzOGzkQ i1AbjlMLqqkxPPxk6EbRi3qDO6LP9x25defSIgW1oH84ykxwsZdM5OGO1GFybyrrGP V1ujy/U8uTvP8n7M0cYaXzNS4YUTSewF6+thtPVsqU/I2zmdO9fNGGyySci6JPrU0P wnq69HWgHdcjyw11oBPlrL1z5xIhhdC/3TqLTBGnchWpVgUeVYY3af6BvXmXrdoPUf gnV5cKm0hZIRg== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11095 Archived-At: --_B6F4771F-98C5-4E8B-A640-CCFB08A42CAC_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Forwarded e-mail/bug report from guile-devel From: Tommi H=C3=B6yn=C3=A4l=C3=A4nmaa Date: dinsdag 5 november 2024 8:25 To: guile-devel@gnu.org Subject: Re: Exporting a nonexistent variable Here is another example: --- mod1.scm --- (define-module (mod1)) (export myproc) (define (myproc0) =C2=A0 (display "Hello\n")) --- end --- --- mod2.scm --- (define-module (mod2)) (export myproc2) (use-modules (mod1)) (define (myproc2) =C2=A0 (display "Hello again\n")) --- end --- --- program.scm --- (use-modules (mod1) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= mod2)) (define (main args) =C2=A0 (myproc)) --- end --- I compiled this example with the following commands: --- cut here --- export GUILE_LOAD_COMPILED_PATH=3D. guild compile --warn=3Dunbound-variable -o mod1.go mod1.scm guild compile --warn=3Dunbound-variable -o mod2.go mod2.scm --- cut here --- The compiler gives no warnings and running "guile -e main -s=20 program.scm" gives the following error: --- cut here --- ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 or pass the --no-auto-compile argum= ent to disable. ;;; compiling /home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm ;;; compiled=20 /home/tohoyn/git/savannah/guile/cache/guile/ccache/3.0-LE-8-4.7/home/tohoyn= /tyo/omat/ohj/scheme/export-test3/program.scm.go Backtrace: In ice-9/boot-9.scm: =C2=A0 1762:12=C2=A0 4 (with-exception-handler _ _ #:unwind? _ # _) In unknown file: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3 (apply-smob= /0 #) In ice-9/boot-9.scm: =C2=A0=C2=A0=C2=A0 731:2=C2=A0 2 (call-with-prompt _ _ #) In ice-9/eval.scm: =C2=A0=C2=A0=C2=A0 619:8=C2=A0 1 (_ #(#(#))) In /home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 6:3=C2=A0 0 (main _) /home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm:6:3: In=20 procedure main: Unbound variable: myproc --- cut here --- =C2=A0=C2=A0=C2=A0=C2=A0 - Tommi H=C3=B6yn=C3=A4l=C3=A4nmaa --=20 Kotisivu / Homepage: http://www.iki.fi/tohoyn/ S=C3=A4hk=C3=B6posti / E-Mail: tommi.hoynalanmaa@iki.fi GPG-sormenj=C3=A4lki / GPG fingerprint: 55F4 2477 7155 3528 5CB2 2B7A BB86 1FDE 4046 0F83 FT, Debian-yll=C3=A4pit=C3=A4j=C3=A4 / PhD, Debian Maintainer --_B6F4771F-98C5-4E8B-A640-CCFB08A42CAC_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Forwa= rded e-mail/bug report from guile-devel

 =

From: Tommi H=C3=B6yn=C3=A4l=C3=A4nmaa
Date: dinsdag = 5 november 2024 8:25
To: g= uile-devel@gnu.org
Subject: Re: Exporting a nonexistent varia= ble

 

Here is another example:

 

--- mod1.scm ---

(define-module (m= od1))

 

(ex= port myproc)

 

(define (myproc0)

  (display "Hello\= n"))

 

--- end ---

 

--- mod2.scm ---

(define-module (mod2))

 

(export myproc2)=

 

(use-mod= ules (mod1))

 

(define (myproc2)

  (display "Hello = again\n"))

 

--- end ---

 

--- program.scm ---

(use-modules (mod1)

        &nb= sp;    (mod2))

 

=

(define (main args)

  (m= yproc))

 

-= -- end ---

 

I compiled this example with the following commands:

 

--- cut here ---

 

export GUILE_LOAD_CO= MPILED_PATH=3D.

guild compile --warn=3Dunbound-vari= able -o mod1.go mod1.scm

guild compile --warn=3Dunb= ound-variable -o mod2.go mod2.scm

 =

--- cut here ---

&nbs= p;

The compiler gives no warnings and running= "guile -e main -s

program.scm" gives th= e following error:

 

--- cut here ---

 

;;; note: auto-compilation is enabled, set GUILE_AUTO_COM= PILE=3D0

;;;       or= pass the --no-auto-compile argument to disable.

;;= ; compiling /home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm

;;; compiled

/home/tohoyn/git/s= avannah/guile/cache/guile/ccache/3.0-LE-8-4.7/home/tohoyn/tyo/omat/ohj/sche= me/export-test3/program.scm.go

Backtrace:

In ice-9/boot-9.scm:

  1762:12=   4 (with-exception-handler _ _ #:unwind? _ # _)

In unknown file:

     =       3 (apply-smob/0 #<thunk 7f2fda699300>)=

In ice-9/boot-9.scm:

&nbs= p;   731:2  2 (call-with-prompt _ _ #<procedure default-p= rompt-handle=E2=80=A6>)

In ice-9/eval.scm:

    619:8  1 (_ #(#(#<directory = (guile-user) 7f2fda69cc80>)))

In /home/tohoyn/ty= o/omat/ohj/scheme/export-test3/program.scm:

 =      6:3  0 (main _)

=  

/home/tohoyn/tyo/omat/ohj/scheme/expor= t-test3/program.scm:6:3: In

procedure main:

Unbound variable: myproc

&nb= sp;

--- cut here ---

=  

     - Tommi= H=C3=B6yn=C3=A4l=C3=A4nmaa

 

--

Kotisivu / Homepage: http://= www.iki.fi/tohoyn/

S=C3=A4hk=C3=B6posti / E-Mail: t= ommi.hoynalanmaa@iki.fi

GPG-sormenj=C3=A4lki / GPG = fingerprint:

55F4 2477 7155 3528 5CB2 2B7A BB86 1FD= E 4046 0F83

FT, Debian-yll=C3=A4pit=C3=A4j=C3=A4 / = PhD, Debian Maintainer

 

 

= --_B6F4771F-98C5-4E8B-A640-CCFB08A42CAC_--