[r6rs-discuss] [Formal] Max and min with zero arguments
lord at emf.net
Sat Dec 16 23:42:21 EST 2006
It would also fall apart in an exotic implementation that
had larger infinities (e.g., some variation on Conway's
construction of numbers).
As always, there are two separate questions: (1) can a sensible
implementation work the way John suggests (and what would
that be like); (2) should the standard *require* implementations
to work that way.
The answer to (2) is almost never "yes" and the question of
(1) is almost always the more interesting one (these days...
30 years ago it appears to have been a different story).
Making this a very peculiar sort of list....
Peter Gavin wrote:
> On 12/13/06, John Cowan <cowan at ccil.org> wrote:
>> In R5RS the max and min functions must take at least one argument,
>> because there is no universal maximum or minimum. In R6RS, however, we
>> have +0.inf and -0.inf. I suggest, therefore, that (max) => -0.inf and
>> (min) => +0.inf. This also allows multiple-argument max and min to be
>> defined using a fold primitive ver two-argument versions.
> I can already see a problem with this. +0.inf and -0.inf are
> inexacts. Since e.g.
> (max 3.9 4) => 4.0 (see section 18.104.22.168)
> this would cause max and min to always return inexact numbers. This
> is definitely not desirable.
> r6rs-discuss mailing list
> r6rs-discuss at lists.r6rs.org
More information about the r6rs-discuss