<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
On Thu, 2011-10-20 at 19:40 -0400, Marc Feeley wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>

On 2011-10-20, at 5:54 PM, Bradley Lucier wrote:


> On Oct 20, 2011, at 3:42 PM, Marc Feeley wrote:

>> On 2011-10-20, at 3:39 PM, Bradley Lucier wrote:
>> 
>>> Perhaps +nan.0 (and perhaps other system-dependent constants) should always be computed at load time for the module.
>> 
>> Perhaps, but how do you recreate the NaN that was compiled?

> But why would you want to?

So that gsc is a function of one argument: from Scheme source code to C source code, i.e.

    Scheme_source -> C_source

instead of

    Scheme_source * platform -> C_source

>  On one machine, it might be a signaling NaN, on another, it might be silent.

But there is just one +nan.0 available in Scheme source code.
</PRE>
</BLOCKQUOTE>
<BR>
There is only one lexical symbol "+nan.0" in (Gambit) scheme code.  In my opinion it should represent a generic NaN on the machine where the code is running.  At load time a NaN can be boxed up and bound to +nan.0.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
  We are talking about the representation of this NaN, not all possible NaNs.
</PRE>
</BLOCKQUOTE>
<BR>
I don't know what you mean "this NaN".  On output, this symbol is used for any NaN that is given to display.  There is no "this NaN".<BR>
<BR>
Some on the R7RS committee have said explicitly that they think that there is "one NaN", and then this leads to problems.  As  you say, gsc shouldn't use the bit representation of a specific NaN on the machine where gsc is running.  But if you fix a bit pattern for the NaN generated by gsc, then that NaN may be interpreted differently when the code is running on different machines.  (It may be signalling on one machine, and non-signalling on another.)<BR>
<BR>
Anyway, it's not that important.  Your solution has the great benefit of not having people worry about test failures that are not that important.<BR>
<BR>
I've argued before (to little avail) that the notation for NaNs in scheme should allow the programmer to specify the sign and the (nonzero) mantissa of a NaN, and that those quantities should be displayed by "display".<BR>
<BR>
Brad
</BODY>
</HTML>