I'm actually working on file support and am currently fiddling with SOURCE-ID, but I noticed something about BLK. The ANS-2012 standard is clear that QUIT needs to set SOURCE-ID to zero to reset back to the regular user input device, but it doesn't mention BLK anywhere. My understanding is that BLK is checked first, before SOURCE-ID is consulted, to see if the input source is a block. That would seem to indicate that QUIT should set BLK to zero.
I did a quick test on TaliForth2 to generate an error, and it does not set BLK back to zero on an error in a block.
Code:
blk ? 0 ok
1 load Interpreting a compile-only word
blk ? 1 ok
The same kind of test on gforth seems to show that gforth does set BLK back to zero, but gforth also has exception handling (meaning that it might not head all the way to QUIT).
Code:
blk ? 0 ok
4 load
* a block*:4: Undefined word
>>>asdfhi<<<
blk ? 0 ok
I understand that blocks are kind of left-overs from a previous era, but I find them very useful for accessing I2C flash memories so I would like to support them. Should I modify QUIT to store a 0 in BLK (or is there any reason not to)?