guile-devel
[Top][All Lists]
Advanced

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

Re: scm_* API question


From: Christopher Cramer
Subject: Re: scm_* API question
Date: Tue, 30 Jul 2002 20:09:29 -0500
User-agent: Mutt/1.2.5i

On Tue, Jul 30, 2002 at 02:14:36PM +0200, address@hidden wrote:
> in my application i have a SCM value that holds 
> a list of symbols. I need to 
> 
> a) find the module that corresponds to this list,
>    i.e. the scm_* counterpart of guile's resolve-module.
>    Is:
> 
>      SCM my_list, my_module, my_symbol;
>      
>      ...
>      my_module = scm_resolve_module(my_list);
> 
>    the right way?

Yes. Well, I think it might fail if the module isn't already loaded.

> b) access symbols from the module. Is:
> 
>      my_symbol = scm_module_lookup(my_module, a_symbol);
> 
>    ok?

Yes.

> c) use the module i found in step a. Hmm, the only thing i 
>    found so far is 'scm_c_use_module(char *)', but that takes
>    a string (even without the enclosing brackets!) so i can't 
>    really use this (or do i have to build the string myself
>    from my SCM list? Kind of silly, considering the fact that the
>    list was built from a string using scm_c_read_string(char *).

Well, scm_c_use_module just calls process-use-modules, so you could
do that directly.

>    Oh, btw, whad _does_ scm_c_read_string return if string isn't
>    a valid S-expression?

It shouldn't return, but throw an exception with the misc-error key
and a helpful message.

-- 
Christopher Cramer <address@hidden> <http://www.pyro.net/~crayc/>
On résiste à l'invasion des armées; on ne résiste pas à l'invasion
des idées.  -- Victor Hugo



reply via email to

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