apply [[] [] abc ] [] crashes FMSLogo
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
If you execute
APPLY [[] [IGNORE 1](LIST "\}) ] []
FMSLogo stops working (crashes). This is reproducible on FMSLogo 8.4.0. It's not reproducible on MSWLogo 6.5b. That version has better behavior in that it prints the following to the commander:
unexpected '}'
However, this is not an error that can be caught. I think the ideal behavior is to throw an error that can be caught, even if it's not recoverable.
On UCBLogo 6.2.5, this doesn't crash and throws an error, but the error message is strange:
? catch "error [ APPLY [[] [IGNORE 1](LIST "\}) ] [] ]
? show error
[4 APPLY doesn't like [ . ] as input APPLY [ . ]]
The regression was introduced in FMSLogo 6.12.0. In FMSLogo 6.11.0, the behavior matches what's in MSWLogo 6.5b.
I simplified the repro case to
When I wrote the APPLY instruction in the first description, I was trying to get a syntax error in the second line to force a cleanup (untreeify) of the entire body. However, I messed up because the second instruction isn't a list, it's the word
"(LIST. The problem isn't that the second instruction can't be parsed, it's that the instructions are assumed to be lists.Therefore, I think the correct behavior is to throw an error like
That is, APPLY should reject the entire template input as a badly-formed.