Digest #20 2017-08-16

Contributions

[31] 2017-08-15 16:54:05 AntonErtl wrote:

comment - Text mode is a bad idea for file opening

BIN has led us astray at first in Gforth: We thought that the idea was to use BIN like the "b" modes in C's fopen, (and, more importantly, no "b" without BIN) but this led to problems in connection with FILE-POSITION, REPOSITION-FILE, and RESIZE-FILE. And because READ-LINE and WRITE-LINE can make the program completely agnostic about the line terminator, our eventual conclusion was that we open all files in binary code, and deal with CRLF in our implementation of READ-LINE and WRITE-LINE instead of letting the C library translate it into an LF. This has been in use for about 20 years with no complaints.

Replies

[r86] 2017-07-11 15:07:46 StephenPelc replies:

requestClarification - Case sensitivity

Alex - good catch. Since the rationale mentions using wordlists, it would be sensible for the case sensitivity of the key names to be that of the system dictionary. All versions of Proforth and VFX have used wordlists (case-insensitive) for text macros since the late 1980s.

I suspect that we also ought to deal with case sensitivity in terms of the 7-bit ASCII that the standards use. The MPE dictionary tools only convert case for the range A-Z and a-z.