Comment by ๐Ÿš€ stack

Re: "Loading files in nForth: implementation"

In: s/FORTH

@karel, that is fine if it works for you, and I could've had the assembler append other forth files (it alread appends 'nforth.f'). But it turned out to be dead simple:

And in the process I got the sync/abort logic working.

So I do append one file, nforth.f, which normally defines included; and uses it to bootstrap itself by loading nf.f. But the user can stuff anything into nforth.f, say for a single file CGI script.

๐Ÿš€ stack [OP/mod]

2023-09-15 ยท 3 years ago

Original Post

๐ŸŒ’ s/FORTH

๐Ÿš€ stack: [mod]

Loading files in nForth: implementation โ€” Having implemented the normally-compile semantics I discussed in the previous post, I must now tackle the `include` functionality to load more forth code from a file. The problem: since nForth is now a compterpreter (it compiles code and runs/erases it to simulate interpretation), we must compile and run the loading code and the filename into the dictionary to execute the load. If we blindly load on top, the pseudo-interpretive block of code that does...

๐Ÿ’ฌ 2 comments ยท 2023-09-14 ยท 3 years ago