[r6rs-discuss] Comparison procedures' number of arguments
Jon Wilson
j85wilson at fastmail.fm
Mon Oct 27 22:47:46 EDT 2008
Elf wrote:
> On Mon, 27 Oct 2008, Andre van Tonder wrote:
>
>> On Mon, 27 Oct 2008, Elf wrote:
>>
>>> that said, after reading more of the discussion, i am convinced that the
>>> single param comparison procedures should return #t (due to the recurrence
>>> into (AND (comparison? x[n] x[n+1]) ...) demonstrated by aziz and others),
>>> but that the zero param comparison procedures should signal errors. if the
>>> single arg case is the null case of AND, what would the zero arg case be?
>> A recursive definition can have more than one base case. Consider, for
>> example, the Fibonacci sequence. However, if that bothers you, you can
>> define the concept of an ordered sequence declaratively (as was done earlier
>> in this thread: for all pairs of indices i, j s.t. i < j, ....).
>>
>
> i'm fully aware that a recursive definition can have multiple base cases.
> the AND breakdown does not, though.
>
> -elf
For all pairs of indices, i,j s.t. i < j, a_i < a_j.
So this is one big AND over all pairs. If there is only a single elt in
the sequence, there are no pairs, so the result is (AND). If there are
no elts in the sequence, there are no pairs, so the result is (AND).
This seems abundantly clear to me.
Regards,
Jon
More information about the r6rs-discuss
mailing list