GNU bug report logs - #68673
can't export conditional variable set with 'cond')

Previous Next

Package: guile;

Reported by: M <maximedevos <at> telenet.be>

Date: Tue, 23 Jan 2024 14:20:02 UTC

Severity: normal

To reply to this bug, email your comments to 68673 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#68673; Package guile. (Tue, 23 Jan 2024 14:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to M <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 23 Jan 2024 14:20:02 GMT) Full text and rfc822 format available.

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

From: M <maximedevos <at> telenet.be>
To: Mortimer Cladwell <mbcladwell <at> gmail.com>, 
 "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Subject: RE: can't export conditional variable set with 'cond')
Date: Tue, 23 Jan 2024 15:19:30 +0100
[Message part 1 (text/plain, inline)]
>Why can I reset the variables with both 'cond' and 'if' in >env.scm, but
>only the variable reset with 'if' is exported with the updated >value?

Because apparently that’s a bug in Guile, presumably in the implementation of inlining. I propose sending the mail to bug-guile <at> gnu.org.

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

Information forwarded to bug-guile <at> gnu.org:
bug#68673; Package guile. (Tue, 23 Jan 2024 14:24:02 GMT) Full text and rfc822 format available.

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

From: M <maximedevos <at> telenet.be>
To: "68673 <at> debbugs.gnu.org" <68673 <at> debbugs.gnu.org>
Subject: FW: can't export conditional variable set with 'cond'
Date: Tue, 23 Jan 2024 15:23:15 +0100
[Message part 1 (text/plain, inline)]
Let’s include a copy of the actual bug report:


Hi,

Suppose I have the following module "testexport" with the auxiliary module
"env.scm", used to set global environment variables:

-------------testexport.scm begin----------------------------------
(define-module (testexport)
  #:use-module (ice-9 pretty-print)
  #:use-module (env)
  )

(define (main)
  (pretty-print (string-append  "varA in main: " varA))
  (pretty-print (string-append  "varB in main: " varB))
  (pretty-print (string-append  "varC in main: " varC))
  )

(main)
-------------testexport.scm end----------------------------------

-------------env.scm begin----------------------------------
(define-module (env)
  #:use-module (ice-9 pretty-print)
  #:export(varA varB varC))

(define varA "A")
(define varB "")
(define varC "")
(define testval "x")

(cond
 ((string= testval "x") (set! varB "B"))
 ((string= testval "y") (set! varB "error"))
 ((string= testval "z") (set! varB "null"))
 )
(pretty-print (string-append "varB post cond: " varB))

(if (string= testval "x")  (set! varC "C"))
(pretty-print (string-append "varC post if: " varC))
-------------env.scm end----------------------------------

When I run the above I get as output:

"varB post cond: B"
"varC post if: C"
"varA in main: A"
"varB in main: "
"varC in main: C"

Why can I reset the variables with both 'cond' and 'if' in env.scm, but
only the variable reset with 'if' is exported with the updated value?
Thanks
Mortimer

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

This bug report was last modified 102 days ago.

Previous Next


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