From: Spencer
Subject: Comparison Functions with One Argument
Date: 
Message-ID: <1155598695.195108.179970@m73g2000cwd.googlegroups.com>
I've noticed that (= 7), (/= 7), (< 7), (> 7), (<= 7), and (>= 7) all
return "T." What condition are they satisfying--what are the comparison
operators comparing the single argument to?

From: Pascal Bourguignon
Subject: Re: Comparison Functions with One Argument
Date: 
Message-ID: <87psf23mlb.fsf@thalassa.informatimago.com>
"Spencer" <················@gmail.com> writes:

> I've noticed that (= 7), (/= 7), (< 7), (> 7), (<= 7), and (>= 7) all
> return "T." What condition are they satisfying--what are the comparison
> operators comparing the single argument to?

(defun < (arg &rest others)
  (and others (< arg (car others)) (apply (function <) (cdr others))))


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"By filing this bug report you have challenged the honor of my
family. Prepare to die!"
From: Sidney Markowitz
Subject: Re: Comparison Functions with One Argument
Date: 
Message-ID: <44e10eb3$0$34536$742ec2ed@news.sonic.net>
Spencer wrote, On 15/8/06 11:38 AM:
> I've noticed that (= 7), (/= 7), (< 7), (> 7), (<= 7), and (>= 7) all
> return "T." What condition are they satisfying--what are the comparison
> operators comparing the single argument to?

See the language reference, CLtL sec 12.3. Comparisons on Numbers

"These functions each take one or more arguments. If the sequence of arguments
satisfies a certain condition:

=            all the same
/=           all different
<            monotonically increasing
>            monotonically decreasing
<=           monotonically nondecreasing
>=           monotonically nonincreasing

then the predicate is true, and otherwise is false"

-- 
    Sidney Markowitz
    http://www.sidney.com
From: Christophe Rhodes
Subject: Re: Comparison Functions with One Argument
Date: 
Message-ID: <sqwt9aseu7.fsf@cam.ac.uk>
Sidney Markowitz <······@sidney.com> writes:

> Spencer wrote, On 15/8/06 11:38 AM:
>> I've noticed that (= 7), (/= 7), (< 7), (> 7), (<= 7), and (>= 7) all
>> return "T." What condition are they satisfying--what are the comparison
>> operators comparing the single argument to?
>
> See the language reference, CLtL sec 12.3. Comparisons on Numbers

Lest there be any confusion: Common Lisp the Language is not "the
language reference".  The first edition of CLtL was a language
reference to an older dialect of Common Lisp; the second edition was a
snapshot of the work-in-progress to make the current language
reference, the ANSI standard for Common Lisp.  (There's no section
12.3 in the current language reference.)  This is important because
there are noticeable differences between the languages described by
CLtL and by the ANSI standard.

> "These functions each take one or more arguments. If the sequence of arguments
> satisfies a certain condition:
>
> =            all the same
> /=           all different
> <            monotonically increasing
>>            monotonically decreasing
> <=           monotonically nondecreasing
>>=           monotonically nonincreasing
>
> then the predicate is true, and otherwise is false"

The wording is slightly different, but the meaning is the same in the
new document: see e.g.
<http://www.lispworks.com/documentation/HyperSpec/Body/f_eq_sle.htm>
for text derived from the actual language reference.

Christophe