proposing a simpler mechanism R. Kent Dybvig (13 Nov 2009 03:00 UTC)
Re: proposing a simpler mechanism Thomas Bushnell BSG (13 Nov 2009 04:23 UTC)
Re: proposing a simpler mechanism Taylor R Campbell (13 Nov 2009 04:31 UTC)
Re: proposing a simpler mechanism R. Kent Dybvig (13 Nov 2009 16:22 UTC)
Re: proposing a simpler mechanism Per Bothner (13 Nov 2009 16:56 UTC)
Re: proposing a simpler mechanism Thomas Bushnell BSG (13 Nov 2009 04:54 UTC)
Re: proposing a simpler mechanism Alex Queiroz (13 Nov 2009 13:44 UTC)
Re: proposing a simpler mechanism Marc Feeley (13 Nov 2009 14:24 UTC)
Re: proposing a simpler mechanism Thomas Bushnell BSG (13 Nov 2009 18:39 UTC)
Re: proposing a simpler mechanism Thomas Bushnell BSG (13 Nov 2009 18:36 UTC)
Re: proposing a simpler mechanism Alex Queiroz (13 Nov 2009 19:08 UTC)
Re: proposing a simpler mechanism Thomas Bushnell BSG (13 Nov 2009 19:21 UTC)
Re: proposing a simpler mechanism David Van Horn (13 Nov 2009 19:25 UTC)
Re: proposing a simpler mechanism Thomas Bushnell BSG (13 Nov 2009 19:36 UTC)
Re: proposing a simpler mechanism David Van Horn (13 Nov 2009 19:58 UTC)
Re: proposing a simpler mechanism Arthur A. Gleckler (13 Nov 2009 20:25 UTC)
Re: proposing a simpler mechanism David Van Horn (12 Jan 2010 18:51 UTC)

Re: proposing a simpler mechanism Thomas Bushnell BSG 13 Nov 2009 18:39 UTC

On Fri, 2009-11-13 at 08:55 -0500, Marc Feeley wrote:
> > On 11/13/09, Thomas Bushnell BSG <xxxxxx@becket.net> wrote:
> >> I'll admit that, along with Kent Dybvig, I'm no fan of arity
> >> inspection,
> >> for a jillion reasons.  I think it's ill-conceived.
> >>
> >> But if it must happen, how about this:
> >>
> >> (procedure-arity PROC) returns two values, first, the minimum
> >> number of
> >> arguments, and second, whether additional arguments are permissible.
> >> This exactly covers the possibilities for standard Scheme.  It is
> >> trivial to implement given any of the common facilities out there.
> >> It
> >> is clear and simple and easy to specify.
> >>
>
> Then what is (procedure-arity read) ?

(procedure-arity read) => 0, #t

After all, read looks something like:

(define (read . args)
  (cond
    ((null? args) (read-from-port (current-input-port)))
    ((not (null? (cdr args))) (error "bad call to read"))
    (else (read-from-port (car args)))))

Remember: an arity "match" does not mean that your arguments, or even
the number of them, is acceptable.  This is one of the reasons Dybvig
objected to the very concept of an arity tester--people will think that
a "match" means that the number of arguments is ok.

Thomas