Hi,

On Wed 17 Feb 2010 20:03, Thomas Thiriez <tho...@twistedwave.com> writes:

> Here is what you should use for xxx:

Hm, not quite :)

> SCM FindFunc(const char *funcName)
> {
>    SCM funcSymbol = scm_c_lookup(funcName);

scm_c_lookup gives you a variable object, as you note below; better to
call it `funcVar' (or `func_var' if you're shift-impaired :)

>    if (!funcSymbol)

If the var is unbound, scm_c_lookup will throw, no need for error
checking. Also perhaps you were looking for scm_is_false (func_var); see
the section entitled "Dynamic Types" in the manual.

>       // undefined symbol
>       return 0;

Likewise don't return 0 as a SCM

>    return scm_variable_ref(funcSymbol);

This part is right :-)

Cheers,

Andy
-- 
http://wingolog.org/


Reply via email to