Brian Harvey scripsit:

> As a programmer, I'd rather be able to say
> 
>       (if (defined? numerator) ...)
> 
> than drag in a special symbol %rational.

%rational (remember the % is metalanguage, not part of the identifier)
was a thinko for %ratios.  Numerator and denominator are still defined
even if you don't have %ratios (in which case numerator is the identity
function and denominator always answers 1).

> And the recent discussion of
> bignums suggests to me that "has bignums" is not a yes-or-no question;
> I really want to be able to say
> 
>       (if (exact? (string->number 
> "1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
>  ...)
> 
> or whatever range I actually need.

Well, that's the thing.  +%bignums (metalanguage for "the 'bignums'
feature group is present) means that exact integer overflow is an error,
whereas -%bignums means exact integers overflow into inexact results.
So you have to conditionalize to know whether your code will even work,
since it may throw an error instead.

Similarly, +%ratios means you get an exact rational result from / where
the quotient is not an integer, whereas -%ratios means you again get an
inexact result.


-- 
Samuel Johnson on playing the violin:           John Cowan
"Difficult do you call it, Sir?                 [email protected]
 I wish it were impossible."                    http://www.ccil.org/~cowan

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

Reply via email to