On Jan 29, 2008 11:28 AM, Mark Fredrickson <[EMAIL PROTECTED]> wrote:
> Is it possible to determine at run time the arity of function? I'm
> thinking something like
>
> (arity (lambda (x y z) (* x y z)))
> => 3

You can use 'procedure-information':

(procedure-information (lambda (x y z) (* x y z)))

=> (? x y z)

where (? x y z) is an s-expression that you can parse.
It's of less use when the procedure takes variable arguments, though,
and of course it doesn't tell you whether the procedure returns
multiple values.

Graham


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to