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/