Am Samstag, 27. April 2013, 05:34:03 schrieb Josh Grams: > On 2013-04-26 01:58PM, Bernd Paysan wrote: > >I want Gforth to work as library in a C program, too. That means > >I separated the startup process, and call bootmessage through > >gforth_find+gforth_execute before doing gforth_quit. > > I thought that made perfect sense, but now I'm confused. bootmessage is > already deferred -- why do you need to find/execute at runtime instead > of just allowing the deferred word to do its thing?
Because the C part doesn't know where bootmessage is. The point is: In 0.7.0, the startup was: do the setup of hash tables and other stuff, interpret the command line, print the boot message and then enter the QUIT loop. For Gforth as a library within a C program, this is no longer appropriate, since maybe you don't want a QUIT loop at all. So you have the startup part, where Gforth sets up the engine and interprets any passed command line stuff, then C uses find+execute to run the bootmessage, and then it calls gforth_quit, which enters the QUIT loop (this one without a FIND). It could be possible to have bootmessage in the same vector block where QUIT and THROW is, and then no lookup is necessary. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/
signature.asc
Description: This is a digitally signed message part.
