On Mon, Sep 28, 2009 at 12:31:11PM -0400, John Cowan wrote:
> Brian Mastenbrook scripsit:
> 
> > Programs which a required integer range will either work correctly on  
> > a given Scheme, or fail to run immediately because the implementation  
> > does not support the range of exact integers that is required for the  
> > program - but in no case would a program's meaning be dependent on an  
> > implementation-specified integer range.
> 
> That strikes me as over-specification.  Most people in other languages
> don't worry much about the range of the largest kind of fixnums they have,

Sure they do.  Most specify 32 bits but don't mind too much what
happens when you exceed that...

> and it should not be a requirement that Scheme implementations signal
> an error on fixnum overflow -- returning an inexact result should still
> be fine.

It jolly well should, and no, it's not fine.

I can't, at the moment, think of *any* situation where a fixnum
overflow that results in an inexact result would be appropriate,
except perhaps for toy problems like fact.  It certainly isn't
the right answer for any example of linear iteration, counting,
array index calculation, or cryptography.

> But that does mean that it's acceptable to return either exact or inexact
> 2^24 when you add 2^23 to 2^23, which seems to count as meaning "dependent
> on an implementation-specified integer range".

What if you want 2^23 + 1, though?  (Or, perhaps (2^24-1) + 1).

Cheers,

-- 
Andrew

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to