[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scm_* API extension? [was] scm_* API question
From: |
rm |
Subject: |
scm_* API extension? [was] scm_* API question |
Date: |
Wed, 31 Jul 2002 12:03:00 +0200 |
User-agent: |
Mutt/1.3.24i |
On Tue, Jul 30, 2002 at 08:09:29PM -0500, Christopher Cramer wrote:
> > ...
> > my_module = scm_resolve_module(my_list);
> >
> > the right way?
>
> Yes. Well, I think it might fail if the module isn't already loaded.
It _seems_ to work and load the requested module.
>
> Well, scm_c_use_module just calls process-use-modules, so you could
> do that directly.
hmm, 'process-use-modules' is an the _scheme_ level, i'm loking at
the C level -- there seems to be no scm_* level function for this.
Libguile uses a call to the function pointed by 'process_use_modules_var',
but that variable is declared static in modules.c. So, if i understand
right i have to duplicate the code from modules.c (i.e. lookup the
'process-use-modules' function and apply it to my list of symbols).
Would it be usefull to provide a scm_* function for it?
/* file: modules.c */
/*
@code{scm_use_module}(@val{list})
@code{scm_use_module} imports bindings exported from the
module defined by the list of symbols given as the parameter
@var{list}. This function is the equivalent of the guile level
call @code{(use-modules list)}.
*/
void
scm_use_module(SCM list)
{
scm_call_1(SCM_VARIABLE_REF(process_use_module_var), list);
}
> > 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.
>
Ok, thank's a lot for this information.
Ralf Mattes
Re: scm_* API question, Marius Vollmer, 2002/07/31