[racket] arity of + versus <=

From: Arthur Nunes-Harwitt (anh at cs.rit.edu)
Date: Fri Oct 28 12:31:03 EDT 2011


> On Wed, Oct 26, 2011 at 8:32 PM, Dan Grossman <djg at cs.washington.edu> wrote:
>> 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?
> 0 is the additive identity. 1 is the multiplicative identity.
> What is the equality identity?

   That's the wrong question.

   Recall that (= x1 x2 x3 ... xn) means
(x1 = x2) & (x2 = x3) & ... & (xn-1 = xn).

   We're still looking at the identity for &.  Which makes sense for an 
empty sequence but is a little awkward if there is just one element. 
However, we can construe equality on one element as equality with itself, 
which is also true.

   Perhaps any number of arguments is justified.


Arthur Nunes-Harwitt
Computer Science Department, Rochester Institute of Technology
Room 70-3509

"I don't know what the language of the future will be
called, but it will look like LISP."

This email is confidential and intended for the named recipient(s). In
the event the email is received by someone other than the recipient,
please notify the sender at anh at cs.rit.edu.

Posted on the users mailing list.