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
> [email protected]
> http://lists.gnu.org/mailman/listinfo/guile-user
_______________________________________________
Guile-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/guile-user