da Silva, Joe wrote:
I've been following this debate and wondering just what the ISO standards define. As you know, it's not easy reading through the standards and finding obscure little details such as this. <g>
However, I think section 6.13 of ISO-10206 indicates that a program can indeed consist of multiple modules and can include one main program, each of which is terminated by a "full stop" (aka. "period").
Yes, even in any order. This is rather difficult to handle, if a program precedes a required module. A way to do it is to split the source file and pass each part separately to the compiler. This could be done transparently by a preprocessor, and serve as a (more general) replacement for the current feature ...
Also, regarding EOLN and EOF, section 6.7.6.5 indicates that "When eoln(f) is activated, it shall be an error if ... eof(f) is true".
This means, in my words, that it's a runtime error to test EOLn when the file is already at EOF. However, 6.4.3.6 says:
: The structure of the type denoted by text shall define an additional : sequenceÂtype whose values shall be designated lines. A line shall be a : sequence cs~S(endÂofÂline), where cs is a sequence of components possessing : the charÂtype, and endÂofÂline shall represent a special componentÂvalue. : : [...] : : Every value t of the type denoted by text shall satisfy the following two : rules: : : a) If t.M = Inspection, then t.L~t.R shall be a lineÂsequence. : : b) If t.M = Generation, then t.L~t.R shall be ls~cs, where ls is a : lineÂsequence and cs is a sequence of components possessing the : charÂtype. : : NOTE --- 5 In rule b), cs may be considered, especially if it is nonÂempty, : to be a partial line that is being generated. Such a partial line cannot : occur during inspection of a file. Also, cs does not correspond to t.R, : since t.R is the empty sequence if t.M = Generation.
This indicates that it doesn't support partial lines at the end of the file except during writing -- whether or not that's a good idea is certainly arguable (I don't really think so) ...
Frank