GNU bug report logs - #74210
No unbound variable warning when via 'export'

Previous Next

Package: guile;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Tue, 5 Nov 2024 09:24:01 UTC

Severity: normal

To reply to this bug, email your comments to 74210 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#74210; Package guile. (Tue, 05 Nov 2024 09:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 05 Nov 2024 09:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Subject: No unbound variable warning when via 'export'
Date: Tue, 5 Nov 2024 10:23:20 +0100
[Message part 1 (text/plain, inline)]
Forwarded e-mail/bug report from guile-devel

From: Tommi Höynälänmaa
Date: dinsdag 5 november 2024 8:25
To: guile-devel <at> gnu.org
Subject: Re: Exporting a nonexistent variable

Here is another example:

--- mod1.scm ---
(define-module (mod1))

(export myproc)

(define (myproc0)
   (display "Hello\n"))

--- end ---

--- mod2.scm ---
(define-module (mod2))

(export myproc2)

(use-modules (mod1))

(define (myproc2)
   (display "Hello again\n"))

--- end ---

--- program.scm ---
(use-modules (mod1)
              (mod2))

(define (main args)
   (myproc))

--- end ---

I compiled this example with the following commands:

--- cut here ---

export GUILE_LOAD_COMPILED_PATH=.
guild compile --warn=unbound-variable -o mod1.go mod1.scm
guild compile --warn=unbound-variable -o mod2.go mod2.scm

--- cut here ---

The compiler gives no warnings and running "guile -e main -s 
program.scm" gives the following error:

--- cut here ---

;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm
;;; compiled 
/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:
   1762:12  4 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
            3 (apply-smob/0 #<thunk 7f2fda699300>)
In ice-9/boot-9.scm:
     731:2  2 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
     619:8  1 (_ #(#(#<directory (guile-user) 7f2fda69cc80>)))
In /home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm:
       6:3  0 (main _)

/home/tohoyn/tyo/omat/ohj/scheme/export-test3/program.scm:6:3: In 
procedure main:
Unbound variable: myproc

--- cut here ---

      - Tommi Höynälänmaa

-- 
Kotisivu / Homepage: http://www.iki.fi/tohoyn/
Sähköposti / E-Mail: tommi.hoynalanmaa <at> iki.fi
GPG-sormenjälki / GPG fingerprint:
55F4 2477 7155 3528 5CB2 2B7A BB86 1FDE 4046 0F83
FT, Debian-ylläpitäjä / PhD, Debian Maintainer


[Message part 2 (text/html, inline)]

This bug report was last modified 220 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.