-[ Tue, Aug 23, 2011 at 12:36:44PM +0100, Richard Shann ]
I have defined a function with one needed and one optional arg, using
scm_c_define_gsubr (name, 2, 0, 0, callback);
You mean :
scm_c_define_gsubr (name, 1, 1, 0, callback);
don't you ?
Thanks for this, I see there is also scm_is_true to take care of the
possibility that SCM_BOOL_T might not be a scalar type, we should be
using that too.
Richard
On Wed, 2011-08-24 at 12:01 -0400, guile-user-requ...@gnu.org wrote:
Richard Shann richard.sh...@virgin.net writes:
I didn't
I have defined a function with one needed and one optional arg, using
scm_c_define_gsubr (name, 2, 0, 0, callback);
in my function I need to test if the second argument is present, it
looks like I need
scm_defined_p(sym, env)
but, if so, how do I find the value of env for the top-level
On Tue, Aug 23, 2011 at 12:36:44PM +0100, Richard Shann wrote:
I have defined a function with one needed and one optional arg, using
scm_c_define_gsubr (name, 2, 0, 0, callback);
in my function I need to test if the second argument is present, it
looks like I need
scm_defined_p(sym, env
scm_defined_p(sym, env)
but, if so, how do I find the value of env for the top-level
environment?
Not shure I understand you here, Richard. Where would sym come from?
If your function looks like this:
(richards-function required-param an-optional-param)
thane your c function needs
Richard Shann richard.sh...@virgin.net writes:
I didn't find the SCM_UNBNDP() that you mention but since mailing the
list I stumbled on SCM_UNDEFINED and tried
if(opt==SCM_UNDEFINED) ...
and that seems to work.
IIRC, that this works is not actually guaranteed (it depends on the type
of the