Richard Shann <rich...@rshann.plus.com> writes:

> Given a C string that is the name of a Scheme variable what is the call
> I need to make from C to get the value?
>
> That is, in the Scheme I have
>
> (define foo "bar")
>
> Then in C I want to write
>
> SCM bar = scm_var_c_get_val ("foo");//imaginary function name

  SCM bar = scm_variable_ref (scm_c_lookup ("foo"));

For better efficiency, do this just once, after 'foo' has been defined:

  SCM foo_var = scm_c_lookup ("foo");

and henceforth just do:

  SCM bar = scm_variable_ref (foo_var);

     Mark

Reply via email to