[racket] arity of + versus <=

From: Dan Grossman (djg at cs.washington.edu)
Date: Wed Oct 26 23:32:03 EDT 2011

Very minor point, but is there a rationale beyond historical precedent
for + and * to allow any number of arguments but, =, <=, <, >, >= to
require at least two arguments?

It seems more uniform for the comparators to return #t when given 0 or
1 arguments rather than an error.

It would allow writing (apply < xs) instead of (or (null? xs) (null?
(cdr xs)) (apply < xs)).

(Notice I left - out of the discussion.  Since - already has
non-uniform behavior for 1 argument, it seems fine to raise an error
for 0 arguments.)

(No, I don't really care about this detail.)

--Dan


Posted on the users mailing list.