[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] Must have Forth in search-order?

From: Bernd Paysan
Subject: Re: [gforth] Must have Forth in search-order?
Date: Sun, 28 Apr 2013 01:30:20 +0200
User-agent: KMail/4.10.2 (Linux/3.7.10-1.1-desktop; KDE/4.10.2; x86_64; ; )

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"

Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]