unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: rm@fabula.de
Subject: scm_* API extension? [was] scm_* API question
Date: Wed, 31 Jul 2002 12:03:00 +0200	[thread overview]
Message-ID: <20020731100300.GC5661@www> (raw)
In-Reply-To: <20020730200929.A18106@kiwi.pyrotechnics.com>

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

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2002-07-31 10:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-30 12:14 scm_* API question rm
2002-07-31  1:09 ` Christopher Cramer
2002-07-31 10:03   ` rm [this message]
2002-07-31 10:10     ` scm_* API extension? [was] " Marius Vollmer
2002-07-31 18:21       ` rm
2002-07-31 21:59         ` Rob Browning
2002-08-01 10:10           ` rm
2002-08-01 16:51             ` Rob Browning
2002-08-05 15:08         ` Marius Vollmer
2002-08-05 16:06           ` rm
2002-08-05 16:49             ` Marius Vollmer
2002-07-31 20:06       ` Christopher Cramer
2002-07-31 22:14         ` Rob Browning
2002-08-01  9:41         ` rm
2002-08-05 17:51           ` Marius Vollmer
2002-08-05 18:12             ` Han-Wen Nienhuys
2002-08-05 18:45               ` Rob Browning
2002-08-05 18:31             ` Rob Browning
2002-08-05 18:33             ` rm
2002-08-05 15:12         ` Marius Vollmer
2002-07-31 10:11 ` Marius Vollmer
2002-07-31 10:30   ` rm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020731100300.GC5661@www \
    --to=rm@fabula.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).