On Oct 19, 2008, at 9:58 AM, Andre van Tonder wrote:
> On Sat, 18 Oct 2008, Abdulaziz Ghuloum wrote:
>
>> You only need to go back to the description of =, <, >, <=, and >=
>> from the report to figure it out:
>> "These procedures return #t if their arguments are (respectively):
>> equal, monotonically increasing, monotonically decreasing,
>> monotonically nondecreasing, or monotonically nonincreasing, and #f
>> otherwise. "
>
> I agree. It seems clear that the base cases for /all/ of these
> should be #t.
> It would be silly if, for example, whether a sequence is increasing
> could be changed from #t to #f by removing the last element.
> Stated another way, all of these are really an intersection (AND)
> of conditions, and the base (0 argument) case for AND is #t.
I agree, of course. The definitions I've seen (I don't have a
reference handy) define these orders along the lines of:
An ordered sequence A is monotonically increasing if a_i < a_j for
all ordered pairs a_i, a_j in the sequence (meaning i < j).
Or
(define (monotonic? ordered? sequence)
(for-all
(lambda (pair) (ordered? (car pair) (cdr pair)))
(pairs-in sequence)))
Since the empty sequence and a sequence of 1 element have no pairs,
that condition is satisfied naturally for all "ordered?" predicates.
Aziz,,,
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss