6 ms·
> there is only one global (uniform) syntax. While I agree with the general sentiment that Forth does have a syntax, this statement is not true in Forth. Inste
by boomlinde 8y ago
> there is only one global (uniform) syntax.
While I agree with the general sentiment that Forth does have a syntax, this statement is not true in Forth. Instead, syntax is extremely local, because words may take over the parser and compiler to implement their own syntax.
For example, "(" (which is used for comments) is typically implemented as a word that immediately executes during the compilation phase, takes over the input loop and just reads and discards characters until it has discarded the matching ")" character before returning control to the regular compiler. It has its own little parsing loop going on with its own syntax, totally overriding any global syntax for as long as it feels like.