durexforth icon indicating copy to clipboard operation
durexforth copied to clipboard

Make REFILL standard?

Open jkotlinski opened this issue 5 years ago • 3 comments

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.

jkotlinski avatar Mar 18 '20 09:03 jkotlinski

I realize now this was already dismissed in #169

jkotlinski avatar Mar 18 '20 09:03 jkotlinski

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.

jkotlinski avatar Dec 25 '20 18:12 jkotlinski

I think it would make a lot of sense to, some day, fix this incompatibility with the standard.

jkotlinski avatar Aug 05 '22 07:08 jkotlinski