durexforth
durexforth copied to clipboard
Make REFILL standard?
Current implementation different from standard in several ways:
- Standard REFILL returns a flag that is false if no input is available from the current input source.
- DurexForth REFILL closes current input source if no input is available.
- DurexForth REFILL works when a string from EVALUATE is the input source. This is used e.g. to compile the text editor buffer. The standard disallows this use.
Since there are some practical benefits with this non-standard behavior, it may be fine as is. But it could also be argued that REFILL does more than it should.
I realize now this was already dismissed in #169
It's very tricky to figure out how to best deal with multi-line strings passed to EVALUATE.
Right now, EVALUATE splits up those strings in lines, and then calls INTERPRET on each line. It might be that it is appropriate to instead call INTERPRET on the entire multi-line string. That however has other drawbacks, in that a V editor buffer might be INTERPRETed differently depending on whether it is EVALUATEd or pasted into the repl.
I think it would make a lot of sense to, some day, fix this incompatibility with the standard.