Digest #300 2025-07-27

Contributions

[386] 2025-07-26 07:26:00 AntonErtl wrote:

requestClarification - Contradictory specification when u1=0 and the file position is at the end

When read-line is called with u1=0 at the end of the file, flag=true according to

If the operation succeeded, flag is true and ior is zero.

but false according to

If the operation is initiated when the value returned by FILE-POSITION is equal to the value returned by FILE-SIZE for the file identified by fileid, flag is false, ior is zero, and u2 is zero.

Different systems behave differently in this case. This has been pointed out by dxf and is discussed in <2025Jul26.082903@mips.complang.tuwien.ac.at>.

How should we resolve this contradiction?

Moreover, other aspects of the specification have resulted in questions or misunderstandings, so a complete rewrite may be a good idea.


[387] 2025-07-26 18:27:56 EricBlake wrote:

testcase - Compilation of a VALUE child word should not inline its current value

The existing tests of VALUE do not exercise what happens if a value word is compiled, its contents then changed with TO, and then that earlier compilation is executed.

I was working on an optimizing version of COMPILE, in my implementation, and noticed (along with other LITERAL/LIT, behaviors) that when compiling a word that is a child of CONSTANT or VALUE, I could inline the value produced by executing those child words at compilation time, and nearly made the mistake of doing the same for children of VARIABLE. The current testsuite did not flag my mistake, even though it is not in line with traditional semantics. Therefore, I suggest adding this after the existing tests:

T{ 333 TO v1 -> }T
T{ vd1 -> 333 }T

to prove that vd1 was compiled with a reference to the dynamic contents of v1, and not to the inline value that v1 happened to have at the time vd1 was defined.