chibi-scheme icon indicating copy to clipboard operation
chibi-scheme copied to clipboard

`read` does not signal an error when `'` is at the end of the file

Open mnieper opened this issue 9 years ago • 2 comments

Currently, (read (open-input-string "'")) yields (quote #<eof>).

In contrast, 6.13.2. of R7RS says: “If an end of file is encountered after the beginning of an object’s external representation, but the external representation is incomplete and therefore not parsable, an error that satisfies read-error? is signaled."

As ' is a valid beginning of an object's external representation, an error should thus be signaled.

mnieper avatar Jun 04 '16 20:06 mnieper

Likewise, (read (open-input-string "#0=")) evaluates to #<eof> instead of signaling a reader error.

mnieper avatar Jun 05 '16 09:06 mnieper

Hmm... I have to decide whether I want to add the few extra bytes to the executable to support this or just document it as an incompatibility.

ashinn avatar Jun 05 '16 13:06 ashinn