GNU bug report logs - #70534
eval-string: wrong environment for compilation

Previous Next

Package: guile;

Reported by: Nikita Domnitskii <nikita <at> domnitskii.me>

Date: Tue, 23 Apr 2024 11:08:06 UTC

Severity: normal

To reply to this bug, email your comments to 70534 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#70534; Package guile. (Tue, 23 Apr 2024 11:08:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nikita Domnitskii <nikita <at> domnitskii.me>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 23 Apr 2024 11:08:07 GMT) Full text and rfc822 format available.

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

From: Nikita Domnitskii <nikita <at> domnitskii.me>
To: bug-guile <at> gnu.org
Subject: eval-string: wrong environment for compilation
Date: Tue, 23 Apr 2024 17:07:02 +0600
Hi!

I'm pretty sure there is a bug in (ice-9 eval-string) implementation.

If #:compile? is true it doesn't pass current module to the
read-and-compile procedure which in my opinion leads to undesired
behavior:
This code snippet doesn't work
--8<---------------cut here---------------start------------->8---
(let ((module (current-module)))
  ((@ (ice-9 eval-string) eval-string)
   "(define-syntax-rule (comment . _) #f)"
   #:module module
   #:compile? #t)
  ((@ (ice-9 eval-string) eval-string)
   "(comment 1 2 3)"
   #:module module
   #:compile? #t))
--8<---------------cut here---------------end--------------->8---

While this one does
--8<---------------cut here---------------start------------->8---
(let ((module (current-module)))
  ((@ (ice-9 eval-string) eval-string)
   "(define-syntax-rule (comment . _) #f) (comment 1 2 3)"
   #:module module
   #:compile? #t))
--8<---------------cut here---------------end--------------->8---

Fix should be pretty easy. Let me know if it's indeed unintended and
I'll send the patch

-- 
Best Regards,
Nikita Domnitskii




This bug report was last modified 214 days ago.

Previous Next


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