guile-user
[Top][All Lists]
Advanced

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

Re: testing arity


From: Kevin Ryde
Subject: Re: testing arity
Date: Mon, 24 Jul 2006 08:50:16 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Neil Jerram <address@hidden> writes:
>
> And if you're not keen on parsing arity's output, see its definition
> in (ice-9 session) for the procedure properties that it queries to
> produce this.

(procedure-property obj 'arity) being the operative part, it gives a
list of "(required-count optional-count more?)".  "required-count"
many arguments required, plus up to "optional-count" further, or if
the "more?" flag is #t then an arbitrary number more.

I've been using it in my lint program (gratuitous plug).  A few funcs
defined in scheme code take "(foo bar . rest)" style rather than have
an "optional-count", eg. `atan'.


http://www.geocities.com/user42_kevin/guile-lint/index.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]