GNU bug report logs - #78832
[PATCH 2/2] language/bf: do not drop first op

Previous Next

Package: guile;

Reported by: Paul Bolle <pebolle <at> tiscali.nl>

Date: Wed, 18 Jun 2025 21:42:03 UTC

Severity: normal

Tags: patch

Full log


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

From: Paul Bolle <pebolle <at> tiscali.nl>
To: bug-guile <at> gnu.org
Cc: Paul Bolle <pebolle <at> tiscali.nl>
Subject: [PATCH 2/2] language/bf: do not drop first op
Date: Wed, 18 Jun 2025 21:30:24 +0200
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





This bug report was last modified 60 days ago.

Previous Next


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