[racket] arity of + versus <=
On 10/28/11 1:43 PM, Joe Marshall wrote:
> On Fri, Oct 28, 2011 at 10:26 AM, Stephen Bloch<bloch at adelphi.edu> wrote:
>
>>
>> Since there is in fact a well-defined and useful meaning for "(= a b c d e)", to wit "all the numbers a, b, c, d, and e are equal," and a well-defined and useful meaning for "(<= a b c d e)", to wit "the sequence a, b, c, d, e is non-decreasing", it seems reasonable to implement these.
>
> Certainly, but the original poster asked why it doesn't generalize to
> *fewer* arguments.
>
> "(<)" = "the empty sequence is strictly decreasing"?
> "(>)" = "the empty sequence is strictly increasing"?
>
Each term is less than the term before it. Each term is greater than
the term before it.
That seems true in exactly the same that (andmap even? empty) and
(andmap odd? empty) are both true. Each term is even. And odd.
David