This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: gh_lookup no longer works??
- To: guile@sourceware.cygnus.com
- Subject: Re: gh_lookup no longer works??
- From: stevenj@hunsmac.mit.edu (Steven G. Johnson)
- Date: Wed, 25 Aug 1999 15:28:55 -0400
Whoa, that last message got really screwed up somehow...sorry. Here it is
again:
I had a program that was working with earlier versions of guile, but I
tried it out with guile 1.3 and it suddenly stopped working. I have boiled
the problem down to a simple test program, illustrating a suprising thing:
gh_lookup no longer seems to work! (It always returns SCM_UNDEFINED.)
Has some simple thing changed that I wasn't aware of, or what am I missing
here??
The following is the program, the command I used to compile it (egcs-1.1.1,
Redhat Linux 5.2), and the output. The program defines a simple callback
routine called "tst" which calls gh_lookup("foo") and prints out whether or
not "foo" is defined.
#include <stdio.h>
#include <stdlib.h>
#include <guile/gh.h>
SCM tst(void)
{
SCM foo;
printf("Looking up the symbol 'foo...\n");
foo = gh_lookup("foo");
printf("...it was %s\n", foo == SCM_UNDEFINED ? "undefined!" : "defined");
return SCM_UNSPECIFIED;
}
void main_entry(int argc, char *argv[])
{
gh_new_procedure("tst", tst, 0, 0, 0);
gh_repl(argc, argv);
}
int main (int argc, char *argv[])
{
gh_enter (argc, argv, main_entry);
return EXIT_SUCCESS;
}
% cc gbug.c -lguile -ldl -lreadline -lm -o gbug
% ./gbug
guile> (tst)
Looking up the symbol 'foo...
...it was undefined!
guile> (define foo 'bar)
guile> (tst)
Looking up the symbol 'foo...
...it was undefined!
As you can see, it's still printing out that foo is undefined even after
I've defined it.
Thanks for any help you can provide!
Cordially,
Steven G. Johnson