[MORE on the subject of line editing]
I am just discovering the power of (LINE), not only for editing, but for INTERPRET'ing as well. With a simple DO LOOP, I scan the screen buffer and turn all semi-colons into ;S, without saving the screen. Which then allows me to INTERPRET any single word definition on a screen, but still allows one to interpret the screen as a whole if needed for another program.
This really opens up a lot of new possibilities for writing programs. Instead of duplicating lines for each program, one just has one set of lines in a Virtual file and the programs are now mostly just a bunch of 2-BYTE numbers and a line interpreter word AL, with the ability to still add colon words, constants, variables and strings if needed. This reduces every word description down to just 2x 16-bit values and 1x 16-bit address to produce any word description from the Virtual file.
( program word processor) : AL ( scrn# line# ) OVER SCAN (LINE) INTERPRET ; ( AL = Add Line) 1 1 AL 8 7 AL 15 3 AL : NEWWORD ; ...etc
The version of Forth I am using was originally programmed to use floppy disks. But I also discovered it can use a much larger Virtual file on a hard drive. I created a 256kb Virtual file and my new one-line screen editor is making this a hoot. The maximum size of a file under Prodos is 16 Mb and the Virtual file can be expanded as needed up to that limit. This might eventually get filled up and makes the line interpreter way more useful.
The possibilities have suddenly become endless when creating programs, where before I felt Forth was so restricted and bloated with the system being contained in each program and words being duplicated for each program. Now only one Forth system is required, and programs are much smaller when created and can be loaded and forgotten as needed.
Now for the biggest problem of them all. How does one remember where each word description is stored to make a program from such a large Virtual file?
Answer: Easy! With a Virtual file search engine.
|