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

Re: arithmetic issues

This page is part of the web mail archives of SRFI 77 from before July 7th, 2015. The new archives for SRFI 77 contain all messages, not just those from before July 7th, 2015.

Aubrey Jaffer <agj@xxxxxxxxxxxx> writes:

> In R5RS the eof-object has no read-syntax. If it did, then calls to
> READ would be unable to distinguish between an actual end of file
> and an eof object written in a file.

This reason does not apply to NaN. It's not used to signal the end
of file.

> Okay, how about a library function:
> (define NaN (lambda()

What advantage it has over a literal syntax? A NaN must have a literal
syntax anyway for output. So why not use it for input too? All Scheme
values which have a defined output syntax use it also for input.

> So your code is clear and readable, and yet you don't have a
> read/write syntax that makes it unclear whether read is failing or
> just reading an error.

Read should never fail on NaN. If it's present in the stream provided
for reading, it's meant to be read.

   __("<         Marcin Kowalczyk
   \__/       qrczak@xxxxxxxxxx
    ^^     http://qrnik.knm.org.pl/~qrczak/