Forth dialects typically don't have forward referencing _or_ variables that can be defined in the middle of a function, though!
(Though, writing a function long enough that you might want to declare a variable part-way through it would probably be a code smell in Forth...)
Re:Retro: A modern, pragmatic Forth
by wolfgang42 on Thursday July 13, 2023 @02:41AM
(#36705737)
I was vaguely under the impression that Forth only dereferenced words from the dictionary into functions when you call them, but I admit I haven’t actually used it. In that case, being able to reorder your code so you can give the overview of what you’re trying to do before diving into the finer details of its internals does seem like a great help!
McIlroy also touches on this in his review, though from the other direction:
> Perhaps the greatest strength of WEB is that it allows almost any sensible order of presentation. Even if you did not intend to include any documentation, and even if you had an ordinary cross-referencer at your disposal, it would make sense to program in WEB simply to circumvent the unnatural order forced by the syntax of Pascal.
[1] Of “Knuth v McIlroy” fame: https://homepages.cwi.nl/~storm/teaching/reader/BentleyEtAl8...