[racket] arity of + versus <=

From: John Clements (clements at brinckerhoff.org)
Date: Fri Oct 28 12:07:36 EDT 2011

On Oct 28, 2011, at 8:12 AM, Joe Marshall wrote:

> 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?

No, I don't buy that. operators in \alpha X \alpha -> \beta can never have identities, but that doesn't mean they can't be generalized. 

I can definitely imagine that you would choose to disallow unary use of comparison operations to prevent a certain class of programming errors, but it seems pretty clear to me that the generalization of, e.g., <= is "is every sequential pair of items in the argument list related by the given operator."

Am I missing something here?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4624 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20111028/82ee9de4/attachment.p7s>

Posted on the users mailing list.