This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bug #27553 - patch


* Per Bothner [2011-04-12 01:30] writes:

>> Not sure if this is "the right way" to solve this bug. I wanted the
>> stack trace for (/ 1 0) to be the same as (/ 0 0), so that's why I've
>> called IntNum.quotient(), I could have raised the exception immediately,
>> but I thought consistency would be appreciated.
>
> I don't know if the current behavior is a good idea - but it is intentional.
> The meaning of (/ 1 0) is the same as the literal 1/0, which is "exact
> infinity".

R6RS, section 11.7.4.3, says quite clearly: "If all of the arguments are
exact, then the divisors must all be nonzero".  There are even examples
in R6RS for (/ 0 0) and (/ 3 0) with an &assertion exception as the
expected outcome.

> This has some uses - for example the length of an infinite list is (or
> should
> be) infinity.  A range a..1/0 where the upper bound is infinity is a
> range which
> starts with the lower bound and continues forever.  This can also be a
> convenience
> for substring/slicing operations.

Using -1 for this would be less exotic IMO.

Helmut


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]