ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.21k stars 141 forks source link

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

Open mnieper opened 8 years ago

mnieper commented 8 years ago

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 commented 8 years ago

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

ashinn commented 8 years ago

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.