guile-user
[Top][All Lists]
Advanced

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

Re: get procedure?


From: Andy Wingo
Subject: Re: get procedure?
Date: Wed, 17 Feb 2010 21:07:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hi,

On Wed 17 Feb 2010 20:03, Thomas Thiriez <address@hidden> 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

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