This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Guile: Still need to be the "Main" in "main()"???


On Tue, Jun 20, 2000 at 12:10:22PM -0700, Brent Fulgham wrote:
> Okay -- so this is really not a big issue for many cases.  Except,
> what I am doing is writing an add-on module to another program.
> So I don't have control over "main" at all.  Let me be a bit more
> specific.
> 
> I have an existing web server for which I wish to create a Scheme
> extension module.  This module will be loaded by the web server if
> certain configuration directives are present in a config file.
>
[...deleted...]
> 
> Now, what I could do (perhaps) is have the method that loads my
> module call scm_boot_guile(), which could then call another method
> that would finish the module initialization process.  From then
> on, Scheme would be available to the extension.  Does that sound
> reasonable?

You probably can't do it with the existing system, if I understand you
correctly. Essentially, if you want to initialize Guile, and then return
back, and use Guile later, it won't work, since scm_boot_guile()
never returns.

It's done this way so the garbage collector knows what part of the stack
can contain pointers to objects in use. So... I dunno, maybe you could do
it with setjmp. There has been talk of removing the restriction; I know
it wouldn't be terribly hard if one resorts to platform-specific code.

-- 
C. Ray C. aka Christopher Cramer
crayc@pyro.net
http://www.pyro.net/~crayc/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]