This is the mail archive of the
mailing list for the Guile project.
Re: gh_lookup no longer works??
- To: firstname.lastname@example.org
- Subject: Re: gh_lookup no longer works??
- From: email@example.com (Steven G. Johnson)
- Date: Thu, 26 Aug 1999 20:29:04 -0400
- Cc: firstname.lastname@example.org
Russell McManus <email@example.com> wrote:
>Take a look at the guile FAQ, and read the
I don't think the module system (which this FAQ entry describes) is
the problem, since I'm not using modules.
Actually, gh_eval_str works, but gh_lookup doesn't! (I would prefer
to use gh_lookup, which **worked in previous guile versions,** since
unlike gh_eval_str it doesn't abort with an error if the symbol isn't
Here is the output of a version of my test program that tried
gh_lookup("foo") and gh_eval_str("foo"):
guile> (define foo 'bar)
Looking up the symbol 'foo with gh_lookup...
...it was undefined!
Evaluating the symbol 'foo with gh_eval_str...
...it was defined
Can anyone confirm this behavior, e.g. with guile 1.3.2? Here is the
test program, compiled with gcc gbug.c `guile-config link` -o gbug
(guile 1.3, Redhat 5.2 on a P-II):
printf("Looking up the symbol 'foo with gh_lookup...\n");
foo = gh_lookup("foo");
printf("...it was %s\n", foo == SCM_UNDEFINED ? "undefined!" : "defined");
printf("Evaluating the symbol 'foo with gh_eval_str...\n");
foo = gh_eval_str("foo");
printf("...it was %s\n", foo == SCM_UNDEFINED ? "undefined!" :
(foo == SCM_UNSPECIFIED ? "unspecified!" : "defined"));
void main_entry(int argc, char *argv)
gh_new_procedure("tst", tst, 0, 0, 0);
int main(int argc, char *argv)
gh_enter (argc, argv, main_entry);