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

Re: proposing a simpler mechanism



Case-lambda is not a part of standard scheme.  If you mean srfi-16,
notice the way the reference implementation works.  It defines a
procedure with a formals list that looks like this:

(lambda args ....)

That would be an arity of "0, #t" in my system.

Indeed, the 

Now, the procedure it generates happens to do
  (error "Wrong number of arguments to CASE-LAMBDA.")
under various circumstances.

I assume you want to pretend that this error is the "same" as the error
one gets for calling (lambda (x) ...) with other than exactly one
argument.  But why?

*Exactly* which errors are the errors referred to by this arity checking
thing?

If you mean "the parameters in the lambda specification", then
case-lambda defines procedures with entirely indefinite arity (just look
at the lambda expressions!).

Alternatively, if you want to insist that case-lambda arities must be
the "expected" ones for the metaphysical notion of arity, then please
add to srfi 102 mention that the reference implementation of srfi 16 is
now incorrect, and indeed, cannot be portably implemented together with
srfi 102.

Thomas


On Fri, 2009-11-13 at 14:25 -0500, David Van Horn wrote:
> Thomas Bushnell BSG wrote:
> > On Fri, 2009-11-13 at 19:01 +0000, Alex Queiroz wrote:
> >> Hallo,
> >>
> >> On 11/13/09, Thomas Bushnell BSG <tb@xxxxxxxxxx> wrote:
> >>> So what?  Are we now making srfi's have an inelegant interface because
> >>>  some implementations implement standard scheme poorly?
> >>>
> >>      Implementing integer sets is a bit difficult with "elegant" Scheme.
> > 
> > We don't need integer sets.  Scheme does not specify any lambda syntax
> > other than "this is the minimum number of parameters" and "there may be
> > extra parameters".  The only meaning I can understand for "arity" is
> > with reference to the formals lists in lambda expressions.  Some other
> > folks seem to have a rather more metaphysical understanding in mind, but
> > I can't quite figure out just what they mean by it.
> 
> Disjoint arities arise from case-lambda forms, which are a part of 
> Scheme.  No metaphysics needed.
> 
> David