[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple values for R4RS.



>     The predicate "accepts?" seems a little like the (rejected) predicate
>     "continuation?".  A procedure may not complain "up front" about a given
>     number of arguments, but may complain at some later time.  Or it may
>     accept any number of arguments, but ignore all but the first few.  I
>     don't see how "accepts?" can be generally useful if it breaks down in
>     these cases.
> 
> This is like saying that a given object may pass a PAIR? test yet when
> given to a list operation, the operation will flame.  Just because it
> does not cover all cases, it does not mean that it is useless.  Are
> you advocating for removing PAIR? from the language?

There is a difference that I'm surprised you don't see.  When "pair?"
returns #t for an object, I know that I can use "car" or "cdr" without
causing an error.  No similar claim can be made for "accepts?".

If we decide to add "accepts?" to the language, we would have to say
that an implementation is free to return #t if it cannot determine
whether or not a given number of arguments is accepted by a given
procedure.  An implementation might even define "accepts?" as:

   (lambda (procedure arity) #t)

This may seem to water down the predicate, but it only makes explicit
that which must already be true.

Kent