From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 23 07:07:45 2024 Received: (at submit) by debbugs.gnu.org; 23 Apr 2024 11:07:46 +0000 Received: from localhost ([127.0.0.1]:51484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzE00-0005yQ-Go for submit@debbugs.gnu.org; Tue, 23 Apr 2024 07:07:45 -0400 Received: from lists.gnu.org ([2001:470:142::17]:44796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzDzw-0005wh-HC for submit@debbugs.gnu.org; Tue, 23 Apr 2024 07:07:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzDza-0007zh-49 for bug-guile@gnu.org; Tue, 23 Apr 2024 07:07:18 -0400 Received: from out-172.mta1.migadu.com ([95.215.58.172]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzDzV-0001F8-BX for bug-guile@gnu.org; Tue, 23 Apr 2024 07:07:17 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=domnitskii.me; s=key1; t=1713870426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=P2iuC2qI2ml8HO7PlfM6xLeDuHMkNF1fjrZQMK3XyOc=; b=VBqEw9gYX+Gd78X/3+5q8IMqQto6f+LFizZ8eOVdj9mgBB2jDFONlqKW8Tmz1p4njNlpdZ id76+C1OWu05OB6kpUaZwu10Xrbyg28FZgiJY03Q8cqt3MHcxu/UW5WUf70IlaBVQ8/Nz+ YOZnnctFH1h/Xq7iEQB2SbzMh+epPmw= From: Nikita Domnitskii To: bug-guile@gnu.org Subject: eval-string: wrong environment for compilation Date: Tue, 23 Apr 2024 17:07:02 +0600 Message-ID: <87le54z6ax.fsf@domnitskii.me> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.172; envelope-from=nikita@domnitskii.me; helo=out-172.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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