Daniel CAUNE <address@hidden> writes:
> Last night I went deeper in the Guile library code and I saw the
> reason of my application server shutdown. After invoking the
> gh_enter function, the first function that is called after the Guile
> initialization is the function gl_launch_pad, which calls my own
> function and then calls the exit system function. Then all my
> application server shutdowns!
If I understand your problem/question it sounds like you were
expecting to call gh_enter (or scm_boot_guile) to initialize guile and
then have the function return so you can do other things. If so, this
isn't how these functions work. Check the info pages, but these
functions expect you to hand them your "real main function", one whose
return indicates the termination of the app just like returning from
main() normally does.
The original reason for this is just as Lynn explained it -- this used
to be the only way guile could portably find the bottom of the stack.
Also note that as things stand now, you can only run one copy of guile
inside any given app.
In general, if you're the one designing the app, the requirement that
guile be handed your real main function isn't a big deal, but in some
cases this isn't possible. Fortunately, in more recent versions of
guile, clever people have figured out a fairly portable way to find
the bottom of the stack, and so on those platforms, you can use
scm_init_guile, which will return, and then you can go do whatever
else you want in your code.
Hope this helps.
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
GPG=1C58 8B2C FB5E 3F64 EA5C 64AE 78FE E5FE F0CB A0AD