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




  • bug#78831: [PAT... Bug reports for GUILE, GNU's Ubiquitous Extension Language
    • bug#78832:... Bug reports for GUILE, GNU's Ubiquitous Extension Language

Reply via email to