From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 17:41:33 2025 Received: (at submit) by debbugs.gnu.org; 18 Jun 2025 21:41:33 +0000 Received: from localhost ([127.0.0.1]:57225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uS0XE-000641-OS for submit@debbugs.gnu.org; Wed, 18 Jun 2025 17:41:33 -0400 Received: from lists.gnu.org ([2001:470:142::17]:43698) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uRyVC-0000b4-As for submit@debbugs.gnu.org; Wed, 18 Jun 2025 15:31:18 -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 1uRyV3-0005vR-IK for bug-guile@gnu.org; Wed, 18 Jun 2025 15:31:11 -0400 Received: from ewsoutbound.kpnmail.nl ([195.121.94.170]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uRyUx-0007yg-9F for bug-guile@gnu.org; Wed, 18 Jun 2025 15:31:07 -0400 X-KPN-MessageId: e02da526-4c7a-11f0-bc2d-005056ab378f Received: from smtp.kpnmail.nl (unknown [10.31.155.39]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id e02da526-4c7a-11f0-bc2d-005056ab378f; Wed, 18 Jun 2025 21:31:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tiscali.nl; s=tiscali01; h=mime-version:message-id:date:subject:to:from; bh=52etyB8dYWXRiUpJfOxYfm1VsWNwp/NPFtcKUoV3ov8=; b=EapC+24xYH05s10SredifTkiPj4mARxms4A4KjS7El3jYoTW2fmY9dW0zgdTY6c7jS9mzZRfS9JuV aa6TDbh6D6n9gzGYVx+e1fCYMGc7D23O2ATMv0wxSv4oaDeVjj7RVL0VIqElX41w7XiazBe+OOkaZ3 FMlxW7uUhsR9QxiE= X-KPN-MID: 33|N8Gy9OnFNl/ypWbJLo3HfT5WhLJDDtwMHVyA7iR7M2lbh7lmpzNJw/8YEKN4MrA mOvYFHzvqrVBHLEXDt8w9YmTHUk5oouHuioPUKibS768= X-KPN-VerifiedSender: No X-CMASSUN: 33|TXrS1gSWPqwIj2Zbzgh6LNMelhuroTSu2L6TEj7rDe78uzugdV6zISPFCe3ra8j GEp75+zktuybqQiH0k3Z8IA== X-Originating-IP: 84.84.55.189 Received: from fedora.fritz.box (84-84-55-189.fixed.kpn.net [84.84.55.189]) by smtp.xs4all.nl (Halon) with ESMTPSA id c2f7bfff-4c7a-11f0-9c5f-005056ab7447; Wed, 18 Jun 2025 21:30:58 +0200 (CEST) From: Paul Bolle To: bug-guile@gnu.org Subject: [PATCH 2/2] language/bf: do not drop first op Date: Wed, 18 Jun 2025 21:30:24 +0200 Message-ID: <20250618193038.36134-2-pebolle@tiscali.nl> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250618193038.36134-1-pebolle@tiscali.nl> References: <20250618193038.36134-1-pebolle@tiscali.nl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=195.121.94.170; envelope-from=pebolle@tiscali.nl; helo=ewsoutbound.kpnmail.nl X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 18 Jun 2025 17:41:25 -0400 Cc: Paul Bolle 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.3 (/) The output of the infamous bf "Hello World!" program is actually A[bbePehbZ if that program is first compiled to 'scheme and then to 'value. If one stares way too long at that output, the bf program and compile-scheme.scm one realizes that a loop has run nine times instead of ten. This is apparently because the first op is never compiled. So stop skipping the first op. After that it becomes clear that compile-scheme adds a newline. Do not do that: bf can emit newlines just fine. --- module/language/brainfuck/compile-scheme.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/language/brainfuck/compile-scheme.scm b/module/language/brainfuck/compile-scheme.scm index 7a2568dc1..64252d159 100644 --- a/module/language/brainfuck/compile-scheme.scm +++ b/module/language/brainfuck/compile-scheme.scm @@ -55,8 +55,7 @@ (values `(let ((pointer 0) (tape (make-vector ,tape-size 0))) - ,@(compile-body (cdr exp)) - (write-char #\newline)) + ,@(compile-body exp)) env env)) -- 2.49.0