[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Runtime arity?
From: |
Graham Fawcett |
Subject: |
Re: [Chicken-users] Runtime arity? |
Date: |
Tue, 29 Jan 2008 11:32:22 -0500 |
On Jan 29, 2008 11:28 AM, Mark Fredrickson <address@hidden> 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] Runtime arity?, Mark Fredrickson, 2008/01/29
- Re: [Chicken-users] Runtime arity?,
Graham Fawcett <=
- Re: [Chicken-users] Runtime arity?, John Cowan, 2008/01/29
- Re: [Chicken-users] Runtime arity?, Kon Lovett, 2008/01/29
- Re: [Chicken-users] Runtime arity?, Graham Fawcett, 2008/01/29
- Re: [Chicken-users] Runtime arity?, John Cowan, 2008/01/29
- Re: [Chicken-users] Runtime arity?, Kon Lovett, 2008/01/29
- Re: [Chicken-users] Runtime arity?, Mark Fredrickson, 2008/01/29
- Re: [Chicken-users] Runtime arity?, felix winkelmann, 2008/01/31
- Re: [Chicken-users] Runtime arity?, Kon Lovett, 2008/01/31