bug-mit-scheme
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #67109] #\return ignored when reading from (current-input-port)


From: Retropikzel
Subject: Re: [bug #67109] #\return ignored when reading from (current-input-port)
Date: Sat, 10 May 2025 04:08:53 +0000

Sorry about this, it seems to be just my own lack of knowledge of the R6RS and R7RS. The way the behaviour differed on some implementations made it seem like a bug to me. This issue can be closed.

On 09.05.2025 13:17, anonymous wrote:
URL:
  <https://savannah.gnu.org/bugs/?67109>

                 Summary: #\return ignored when reading from
(current-input-port)
                   Group: MIT/GNU Scheme
               Submitter: None
               Submitted: Fri 09 May 2025 10:17:44 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect behavior
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Retropikzel
        Originator Email: retropikzel@iki.fi
             Open/Closed: Open
         Discussion Lock: Any
                Keywords:


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 09 May 2025 10:17:44 AM UTC By: Anonymous
I’m making a portable CGI library and reading characters from the
(current-input-port), I noticed that MIT-scheme leaves out #\return characters when reading from (current-input-port). I’ve made a some tests to showcase
the bug.

read-char.scm:
(import (scheme base)
        (scheme read)
        (scheme write))

(letrec* ((looper (lambda ()
                    (let ((c (read-char (current-input-port))))
                      (when (not (eof-object? c))
                        (write c)
                        (newline)
                        (looper))))))
  (looper))


Run with: printf "Hello\r\n" | <IMPLEMENTATION COMMAND> read-char.scm

Output on Chibi, Chicken, Cyclone, Gambit(interpreter), Foment, Gauche, Guile,
Kawa, Larceny, Racket, Skint, Stklos, tr7:

#\H
#\e
#\l
#\l
#\o
#\return
#\newline

Output on mit-scheme, Sagittarius:
#\H
#\e
#\l
#\l
#\o
#\newline

Output on Loko, Mosh, ypsilon:
#\H
#\e
#\l
#\l
#\o
#\linefeed


read-string.scm:
(import (scheme base)
        (scheme read)
        (scheme write))

(define text-port (open-input-string (string-append "Hello"
                                                    (string #\return)
(string #\newline))))
(letrec* ((looper (lambda ()
                    (let ((c (read-char text-port)))
                      (when (not (eof-object? c))
                        (write c)
                        (newline)
                        (looper))))))
  (looper))

Run with: <IMPLEMENTATION COMMAND> read-string.scm

Output on Chibi, Chicken, Cyclone, Gambit(interpreter) Foment, Gauche, Guile,
Kawa, Larceny, mit-scheme, Racket, Sagittarius, skint, STklos, tr7:
#\H
#\e
#\l
#\l
#\o
#\return
#\newline

Output on Loko, Mosh, ypsilon:
#\H
#\e
#\l
#\l
#\o
#\return
#\linefeed







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67109>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]