-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read-line doesn't recognise \r as end of line #873
Comments
This is not platform dependent. Chibi reads until \n, then discards any trailing \r. I can't recall why we chose to support a lone \r - pre-BSD MacOS doesn't seem worth supporting. I doubt Chibi can even compile on it. |
I agree that recognising lone |
One question is that in REPL |
The content of the |
Yes. it is that same result in REPL in Chicken. But the only different is that |
In MIT/GNU Scheme, it is different, |
Adding a survey to https://github.com/schemedoc/surveys/tree/master/surveys would be appreciated. |
Yes. But seem like it has one file md for this survey, and it does not have too much content in the file. I will raise the issue there. |
|
Thanks. It is the commit 6615a74. But somehow, I feel like that |
One more point, running the below lines in the REPL.
|
Those are correct (except that > 'fooee
fooee
> 'foo\ee
fooee
> 'foo\ee
fooee
> 'foo\\ee
|foo\\ee|
> (read (open-input-string "foo\\\\ee"))
|foo\\ee| |
Note that |
Then:
R7RS says about
read-line
, in part: “For the purpose of this procedure, an end of line consists of either a linefeed character, a carriage return character, or a sequence of a carriage return character followed by a linefeed character.” Which means thatread-line
is required to recognise\r
as end of line, which means the correct output is just"foo"
.This is on Linux. I suspect the behaviour might be different on different platforms – which it shouldn't be.
The text was updated successfully, but these errors were encountered: