On Sun, Jul 4, 2021, at 12:19 AM, Dworkin Muller wrote: > On Sat, 03 Jul 2021 22:33:07 +0100, "Ethan Gardener" > <eeke...@fastmail.fm> wrote: > eekee57> To be honest, it helps that the editor's source code is only > eekee57> about 2.5KB. ;) > > So you're using the Forth environment as your editor, not just using > Forth to drive sam or acme?
Correct. The text to be edited is loaded into memory and various words (commands) work on that memory. Obviously, it can't handle extremely large files as Sam and Acme can. Some Forths have a namespace system which can keep the editor's words from conflicting with others. The Forth I use now doesn't have one, but if I had more applications controlled from Forth, I'd want namespacing. One common scheme simply replaces the first-searched word list when you enter the name of another word list (AKA vocabulary). This is typically extended into something complicated; a full vocabulary stack which needs to be managed with care if you don't want to lose most of the language by accident, but I intend to keep it simple. I've written an interactive editor too, but I only really use it for editing tables in overwrite mode. It would be more useful for writing prose, but you can't really do that in 1KB blocks. I actually wrote a command-based text-file editor before I started to use blocks, but its command language was awkward. I didn't really know the language at the time and I had overly high expectations of myself. I'm about ready to try again now. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T716c5aa0e2aa8a27-M5c40e333cc9c6440de1f3fe2 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription