[r6rs-discuss] [Formal] Max and min with zero arguments

Peter Gavin pgavin at gmail.com
Sat Dec 16 23:24:20 EST 2006


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 9.10.2.3)

this would cause max and min to always return inexact numbers.  This
is definitely not desirable.

Pete



More information about the r6rs-discuss mailing list