Open ruv opened 4 years ago
A testcase has been appended. It is strange that catch
cannot catch this exception.
Why do you execute an anonymous definition rather than use plain interpreted code?
Use [']
in compile state to tick refill
.
The link from "appended" doesn't go to a test case.
Plain interpreted code cannot be used since after refill
the whole input buffer is replaced. So cr . .
will not be executed.
Thanks for the point. It is my typo. Certainly, I used [']
in compiling. I have fixed this typo in the message above.
I use the link to the updated message in the new message for the situation when the new message is read in email client and it is not obvious where something was changed or appended. Nevertheless, I have placed the precise anchor now.
Well, regarding the Backtrace — I overlooked that it prints the result of catch and shows a back trace for the next Stack underflow error, the partial screen content:
[: ['] refill catch cr . . ;] execute
-56 -4
*the terminal*:8:32: error: Stack underflow
[: ['] refill catch cr . . ;] >>>execute<<<
Backtrace:
So my conclusion that catch
does not catch this exception was wrong.
The updated testcase:
[: 0 ['] refill catch cr . . ;] execute
Thanks.
I would expect that in Linux, REFILL should return 0 if a user enters Ctrl+D Enter at the start of a line in interactive mode.
But the actual result: REFILL throws an exception with code -56 (error in "QUIT").
Gforth version: 0.7.9_20200213
Testcase
Expected result: it prints
0 0
Actual result: it prints
-56 0