Ken Dickey wrote:
> Ah.  So 
>   (define (foo? x . rest) #t)
>   (foo? 3 4 5) ;=> #t
>   (foo? 3) ;==> #t
> therefore 
>   (foo?) ;==> #t
> because the base case of all predicates is #t and this is the least 
> restrictive???
>   

You'll have to tell me more about "foo?"

I see what the code *does* but I don't see any account
of what it is supposed to model.

For the numeric comparison functions we have a clear
account of what the code is supposed to model, e.g.,
monotonic sequences of numbers.  It's usual in axiomizations
of math that a sequence has 0 or more members and
we can define equivalence classes of sequences either
constructively, inducing from a base case of 0, or
classically by stating the non-existence of a pair of elements
in the sequence that violate the ordering.    We don't really
gain anything useful by restricting to sequences of length two
or longer and, if anything, that'll just complicate some
proofs.

It's the job of the numeric predicates to model the math
to 0 is a fine choice.

What is foo? supposed to model?  Is it "the arguments
are a sequence?" (tautologically true) or is it "the arguments
are a sequence of length greater than 0? " (not quite what
it does). What's it for?


> What about the principle of least surprise?
>   

I think that principle has to be set aside as not helpful
one way or the other when different people who seem to
share an essential understanding of the underlying domains
being modeled state that they disagree with one another about
what constitutes a surprise.

It's trivially true that if you start with the assumption that
ordering predicates take two arguments you will be surprised
when they don't but that doesn't explain why you had that
assumption in the first place.


> I really find it less surprising if the code does the (perhaps wacky) things 
> I 
> specify than I get "unspecified results".
>   

Where are the unspecified results in the picture here?
I don't follow what you are trying to say.


Anyway, I don't see why you wouldn't be happy with
arbitrary-arity ordering predicates and then defining:

  (arity-restriction MIN MAX PROC)

such that:

  ((arity-restriction 2 #f <)) => error

-t



-t


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to