GNU bug report logs - #73334
[critical bug] The set! doesn't work in indirect reference

Previous Next

Package: guile;

Reported by: Nala Ginrut <nalaginrut <at> gmail.com>

Date: Wed, 18 Sep 2024 14:39:01 UTC

Severity: normal

Full log


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

From: Nala Ginrut <nalaginrut <at> gmail.com>
To: bug-guile <at> gnu.org
Cc: Guile User <guile-user <at> gnu.org>
Subject: [critical bug] The set! doesn't work in indirect reference
Date: Wed, 18 Sep 2024 23:37:54 +0900
[Message part 1 (text/plain, inline)]
Hi folks!
Recently I was bothered by a strange bug when debugging Artanis, here's how
to reproduce.
You need three files, say aaa.scm, bbb.scm, and entry

---------------------aaa.scm----------------
(define-module (aaa)
 #:export (global))

(define global #f)
----------------------aaa.scm end------------

------------------bbb.scm----------------
(define-module (bbb)
 #:use-module (aaa)
 #:export (fun))

(define (fun)
 (pk 'before global)
 (set! global 123)
 (pk 'after global))
-------------------bbb.scm end-------------



------------------entry-------------
(import (bbb))

(fun)
-----------------entry end-------------


Put all files in the same directory, and run:
----------------cut----------------
guile -L . entry
----------------end---------------


The result is:
;;; (before #f)
;;; (after #f)

The expected result should be:
;; (before #f)
;; (after 123)

------------------------------------------

This was tested in 3.0.9 and 3.0.10.

I also CC  guile-user list, in case anyone was troubled by strange bugs,
this may be a hint.


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

This bug report was last modified 272 days ago.

Previous Next


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