From 48c63cac8f1c564e8a5304aa96191693face7f50 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sat, 13 Jun 2026 22:57:04 +0300 Subject: [PATCH] for self-modification to work, THEN is mandatory before line numbers --- README.md | 2 +- lttb-manual.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b32a304..9008911 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The LTTB specification expands upon the original Design Notes in the following m - Any invalid statement (including `REM`) can be used for comments. - No command can be abbreviated inside `IF` statements. - `LET` and `THEN` keywords are optional. -- `IF` statements also allow inserting line numbers after `THEN`, making it possible to write self-modifying programs. +- `IF` statements also allow inserting line numbers after `THEN`, making it possible to write self-modifying programs. In this case, `THEN` is mandatory. - A special `RND(n)` function is introduced that generates a random number from 0 to `n-1`. - The `NEW` command is synonym to `CLEAR`. - The `BYE` command can be used to exit the interpreter. diff --git a/lttb-manual.md b/lttb-manual.md index 6977b87..1e16896 100644 --- a/lttb-manual.md +++ b/lttb-manual.md @@ -62,7 +62,7 @@ Execute a statement `[stmt]` if the relation denoted by `relop` holds between `[ Examples: `IF A > B THEN LET C = A-B`, `IF X<1000 THEN GOTO 400` -Non-standard extension: if the `[stmt]` statement starts with a line number, LTTB doesn't execute it immediately but instead overwrites the original line with the number it starts with. This allows writing self-modifying programs in LTTB. +Non-standard extension: if `THEN` is specified **explicitly** and the `[stmt]` statement starts with a line number, LTTB doesn't execute it immediately but instead overwrites the original line with the number it starts with. This allows writing self-modifying programs in LTTB. ### `GOTO [expr]`