I’m seeing some discrepancy in how the return value of
@catch is handled vis-à-vis Quetzal.
There are two relevant parts of Quetzal here:
§4.11: “in all versions other than V6 a dummy stack frame must be stored as the first in the file”
§6.2: “catch is hereby specified to return the number of frames currently on the system stack”
The question is: does the dummy frame count toward the number of frames on the system stack? This can be illustrated with the following simple program, compiled to version 5:
[Main i; @catch -> i; print i, "^"; ];
For interpreters which implement Quetzal, this
@catch should always return the same value. But that’s not the case. Interpreters which assume the dummy frame does not count return 1, while others return 2.
I tested several interpreters, and most returned 1. The notable exceptions are Fizmo and Lectrote, which both return 2 (ZMPP returns 0, which is obviously incorrect).
This should probably be clarified so that saves of games which make use of
@catch can properly be shared between interpreters. The general consensus seems to be 1, but the most important thing is all interpreters agree; less important is what they agree on.