[r6rs-discuss] Comparison procedures' number of arguments

Thomas Lord lord at emf.net
Sun Oct 19 21:08:19 EDT 2008


Ken Dickey wrote:
> On Sunday 19 October 2008 15:16:47 Thomas Lord wrote:
>   
>> Why do you need the extra baggage of "sequences of length greater than or 
>>     
> equal  to two?"
>
> The difference is in the term "sequence" which is not mentioned in (e.g.) R6RS 
> numeric discussions.
>
> I have done plenty of sorting, but have never used Scheme seriously for 
> numeric sequences.  My usages are more typically something like:
>   (if (< lo-bound x high-bound) ... )
>   

This seems hypocritical to me. 

On the one hand, you don't want to allow 0 or 1 argument because
you see < as a binary relation and those cases don't make sense
unless we're treating < as sequence predicate.  You want the error
checking to rule out 0 or 1 arguments to avoid "surprise" to
someone who sees a binary operator there.

On the other hand, you'll allow 3 arguments because it is
convenient and in spite of the fact that it rules out error checking
for someone who sees a binary operator there.

> I don't consider (low-bound x high-bound) to be a sequence 

Parameter lists satisfy any reasonable axiom system for finite
sequences so they are such regardless of whether or not you give
the matter your consideration.

But, now you have a "consideration deficit".   I can easily "explain"
the meaning of (< a b c) by referring to a binary relation and its
natural extension to finite sequences -- but then I'll also explain
(<) and (< a) so you'll still owe explanation of why just those two
cases get ruled out.   On the other hand, if the natural extension to
finite sequences is not *your* explanation for (< a b c ...) you
owe *that* explanation.  

Your selection of what to call an error seems to me on a shaky
ground of trying to predict "common cases" rather than asking
how to make clean models.




> (unless a sequence 
> of lexical tokens--but that again is a different domain).
>
>   

Parameter lists and the results of unpacking lists into parameters
used by "apply" are, at run time, semantically finite tuples, or
finite lists, or finite sequences -- all the same thing.


-t




> Yes.  This is a difference in perspective -- and usage.
>
>   





> -KenD
>
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20081019/a50ae364/attachment.htm 


More information about the r6rs-discuss mailing list