unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: 74210@debbugs.gnu.org
Subject: bug#74210: No unbound variable warning when via 'export'
Date: Tue, 5 Nov 2024 10:23:20 +0100	[thread overview]
Message-ID: <20241105102323.YxPN2D0014tRJL601xPNwn@laurent.telenet-ops.be> (raw)
In-Reply-To: <0effbe63-caee-a08b-77e0-576c3fe4b25c@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2225 bytes --]

Forwarded e-mail/bug report from guile-devel

From: Tommi Höynälänmaa
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)
   (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@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



[-- Attachment #2: Type: text/html, Size: 6060 bytes --]

           reply	other threads:[~2024-11-05  9:23 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <0effbe63-caee-a08b-77e0-576c3fe4b25c@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241105102323.YxPN2D0014tRJL601xPNwn@laurent.telenet-ops.be \
    --to=bug-guile@gnu.org \
    --cc=74210@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).