[R6RS] division by exact zero (again, sorry)

William D Clinger will at ccs.neu.edu
Tue Mar 6 10:44:26 EST 2007


Kent wrote:
> Also, based on middle rule in the quoted agreement, the example that reads
> 
>   (/ 0 3.5) => 0.0 ; inexact
> 
> should actually read
> 
>   (/ 0 3.5) => 0 or 0.0

Oh glarg.  Please don't do that, as it runs
contrary to the principles set forth in 9.9.1:

    The general rule is that the generic operations
    return the correct exact result when all of their
    arguments are exact and the result is mathematically
    well-defined, but return an inexact result when any
    argument is inexact....

    One general exception to the rule above is that
    an implementation may return an exact result
    despite inexact arguments if that exact result
    would be the correct result for all possible
    substitutions of exact arguments for the inexact
    ones.

I would guess that Kent's argument is that the &assertion
exception that results from (/ 0 0) doesn't count as a
result.  If the chair of the editors' committee wants the
R6RS to contain examples that encourage implementors to
interpret its mandates in specious ways, then I suppose
(/ 0 3.5) => 0 or 0.0 would do the trick.

Will



More information about the R6RS mailing list