If you define a procedure that runs STOP before reaching a line of code that runs an unknown procedure, the error for the unknown procedure is still thrown. That error is thrown before any instruction line within the procedure executed.
Steps to Reproduce:
TO SHOWBUG
PRINT [Before STOP]
STOP
PRINT [After STOP]
UNKNOWN1 1
(UNKNOWN2)
(UNKNOWN3 1)
END
SHOWBUG
What happens:
FMSLogo throws an error like
I don't know how to UNKNOWN3 in showbug
[(UNKNOWN3 1)]
Expected Result:
The commander prints
Before STOP
Note that UNKNOWN1 1 and (UNKNOWN2) don't throw errors.
This bug is also reproducible in UCBLogo 6.2.5.
This error is only shown when the unknown procedure is run in parentheses and has arguments.
This feels like a bug in that it's surprising. From the Logo programmer's point of view, why should adding parens change the behavior and only then if there are arguments? And for an interpreted language, why does an error on a line that isn't run supersede running any lines?
I encountered this while trying to update the regression tests to be runnable on GNU/Linux. I wasn't able to exit early from the test procedure by adding this:
IF NOT ISWINDOWS [ STOP ] ; This test only runs on Windows
Because a subsequent call to (DLLFREE "gdi32.dll) halted the tests with an error.