[Top][All Lists]

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

Re: Guile truly embedable ?

From: Martin Grabmueller
Subject: Re: Guile truly embedable ?
Date: Thu, 3 May 2001 11:20:04 +0200 (MET DST)

> From: "Nicholas Harbour" <address@hidden>
> Date: Mon, 30 Apr 2001 16:45:42 -0400
> forgive me for being new to guile, but I am a bit confused here.  The method
> I am currently using differs from this one and I was wondering which is the
> preferred way.  The program I am working on uses gh_enter() and then calls
> gh_eval_file() on a startup script, then later on in the program it uses
> various methods to get the values of certain variables that are defined in
> the startup scripts.  I assumed this fit the bill as embeddable since the
> main execution of the program lies outside of guile.  should I be using the
> scm_boot_guile method instead of the gh_* method?

gh_enter() is completely equivalent to scm_boot_guile() (In fact, the
former is implemented in terms of the latter, but that might change in
the future.)

> then the way I am currently accessing it is like this:
>       SCM foo_scm;
>       char *foo;
>       int foo_len;
>       foo_scm = gh_eval_str("foo");
>       foo = gh_scm2newstr(foo_scm, &foo_len);
> Is there a better way to access scheme values by name and not by SCM?

You may want to use

  SCM gh_lookup (const char *sname);

which expects a C-string and returns the value of the corresponding
Scheme variable.


reply via email to

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