4 ms·
Lots of forths can quote, which is kind of what you are asking here - https://retroforth.org/Handbook-Latest.txt https://retroforth.org/Handbook-Latest.txt Retr
by alexisread 2y ago
Lots of forths can quote, which is kind of what you are asking here - https://retroforth.org/Handbook-Latest.txt https://retroforth.org/Handbook-Latest.txt
Retro uses operators on the quote.
Similarly, Freeforth (anonymous definitions) and Able Forth (same) can do this.
You also have aliasing and hooks in the languages as other tools.
The way Rebol and derivatives (Red, Rye) treat blocks and dialects
[myword yourword] executedword
is similar, though they are all interpreted, not compiled.
- kragen 2y agoi think you've misunderstood what kaz was asking retroforth quotes are just anonymous definitions, and the words inside of them have the same meaning they would have in any other definition. as far as i can tell, you can't even index into them or query their length the way you can with {executable arrays} in postscript. i think the same is true of anonymous definitions in freeforth and able forth ansi standard forth has :noname https://forth-standard.org/standard/core/ColonNONAME https://forth-standard.org/standard/core/ColonNONAME which is the same thing as retroforth quotes, except that it doesn't nest within other definitions, so you can't use it to define properly nesting control structures, the way retroforth does but kaz was asking if it's possible to construct a context that gives the words inside it a completely different meaning, so that you can interpret dup, rot, and swap in a way that is unrelated to duplicating, rotating and swapping stack elements. this is in fact possible in ansi forth and in most other forths (my comment sibling to yours explains how), although i don't know if it's possible in the forths you've mentioned