💾 Archived View for bbs.geminispace.org › s › FORTH › 5339 captured on 2024-06-16 at 19:34:21. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-05-26)
-=-=-=-=-=-=-
Re: "Loading files in nForth: implementation"
@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:
: included; \ (fname,cnt--) drop zero dup rot osopen pop drop \ do not return to brace loadh ;
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.
2023-09-15 · 9 months ago
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...