[Top][All Lists]

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

Re: testing number of arguments of a closure

From: rm
Subject: Re: testing number of arguments of a closure
Date: Sun, 3 Nov 2002 22:15:58 +0100
User-agent: Mutt/1.3.28i

On Sun, Nov 03, 2002 at 08:50:05PM +0000, Nic Ferrier wrote:
> I'd like to be able to create a closure using scm_c_eval_string and
> then test the returned proc to see whether it has the correct (which
> depends on some external context) number of arguments.
> For example:
>    SCM myproc = scm_c_eval_string("(lambda (x y) (+ x y))");
>    if ( has_args(myproc, 2) )
>      // do something
>    else
>      // signal error.
> Is there a guile way to do "has_args" above?

 Are you looking for the  c-level equivalent of the "arity" function?
 ralf mattes

reply via email to

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