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

Full log


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 1 year and 112 days ago.

Previous Next


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