[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: testing arity
From: |
rm |
Subject: |
Re: testing arity |
Date: |
Sat, 22 Jul 2006 21:27:19 +0000 |
User-agent: |
Mutt/1.5.9i |
On Sat, Jul 22, 2006 at 11:19:28AM -0500, Jon Wilson wrote:
> Hi,
> Is there a good way to determine the number of arguments that a given
> procedure will take? I suppose I can look at
> (source proc)
> and extract the list of formals, and write a procedure which does this
> automatically, but I'd hate to reinvent the wheel. Also, I'm not sure how
> well using source will work when we have optional or keyword arguments.
What doesn't work with 'arity'?
guile> (define (myne n m) (* n m))
guile> (arity myne)
2 arguments: `n' and `m'.
Cheers, Ralf Mattes
> Also, on an unrelated note, is it possible to define values (as in (lambda
> () (values 1 2)) ) in terms of McCarthy's original seven lisp primitives?
> Or would this question be better asked somewhere else (like c.l.scheme)?
> Regards,
> Jon
>
>
> _______________________________________________
> Guile-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/guile-user