[Top][All Lists]

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

testing number of arguments of a closure

From: Nic Ferrier
Subject: testing number of arguments of a closure
Date: 03 Nov 2002 20:50:05 +0000

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
     // signal error.

Is there a guile way to do "has_args" above?

I thought that one way to do this would be to eval an existing
s-expr (after having checked the syntax myself) but there seems to be
no way to do that either.

I'm aware that the manuals are in flux, so I thought I'd ask
here. I hope no one minds.


reply via email to

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