guile-user
[Top][All Lists]
Advanced

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

Re: Invoking guile procs from C in an efficient way


From: Victor Morilla
Subject: Re: Invoking guile procs from C in an efficient way
Date: Tue, 26 Oct 2004 13:58:04 -0700 (PDT)

Rob Browning wrote:
>
>In some cases you can also cache the binding if you
want to avoid
>repeated lookups (using 1.6 interfaces):
>
> foo()
>  {
>    static SCM my_proc = SCM_BOOL_F;
>    if(SCM_FALSEP(my_proc))
>    {
>      my_proc = scm_c_lookup("my-proc");  /* or
scm_c_module_lookup */
>      /* check for failure here */
>      scm_permanent_object(my_proc); /* presumes you
always need my_proc */
>    }

>    scm_apply(scm_variable_ref(my_proc), argslist,
SCM_EOL);
>  }

Thank you, Rob.

Why scm_permanent_object is used ? Would it be
equivalent something like:

foo()
{
  static SCM my_proc =
scm_variable_ref(scm_c_lookup("my-proc"));
  scm_apply(my_proc, argslist, SCM_EOL);
}




        
                
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail




reply via email to

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