If you have a line like this:
FD 100 RT "bad
The turtle moves forward 100 steps, then throws a "RT doesn't like bad as input" error. However, if you have a different sort of error, like this:
FD 100 (RT 90 "bad)
The turtle does not move.
An implementation detail such the fact that FMSLogo runparses instructions line-by-line, instead of instruction-by-instruction, shouldn't cause a behavioral different than is exposed to the programmer. Ideally, there would be no different in how the different errors are handled.
This bug (if you don't consider is a feature) is present in UCBLogo, too. It is mildly annoying to purists, but I don't think it's a big deal. It may never get fixed. Still, I'm filing for tracking purposes.
How Reproducible:
Every Time
Steps to Reproduce:
FD 100 (RT 90 "bad)
What Happens:
The turtle doesn't move.
Logo throws a "too much inside ()" error.
Expected Result:
The turtle moves forward 100 steps.
Logo throws a "too much inside ()" error.
I have committed [r6266], which fixes the exact bug cited in the repro. This fix will be available in FMSLogo 8.6.0.
There are other, similar parsing errors that my fix doesn't cover, like when there's a stray closing paren as in
FD 100 ). A complete fix would remove all code paths which throw an error from paren_expr and the functions that it calls. I'm going to keep this bug open for now to see if I can fix those, as well.Related
Commit: [r6266]
FORWARD 100 (was fixed by [r6267].FORWARD 100 5**6was fixed by [r6268].FORWARD 100 )was fixed by [r6272].FORWARD 100 5*was fixed by [r6274].FORWARD)now throws a "not enough inputs to FORWARD" error instead of an "Unexpected ')'" error.These fixes will be available in FMSLogo 8.6.0.
The problem was that the error was thrown by the treeification process, which processes all lines of a procedure before evaluating any of them. The general pattern of the fix is to delay throwing the error from the treeification process to the evaluation process.
Related
Commit: [r6267]
Commit: [r6268]
Commit: [r6272]
Commit: [r6274]