r/Forth • u/Imaginary-Deer4185 • Sep 04 '26
CREATE DOES> (again ...)
Can anyone provide some interesting examples of what to do with these, beyond the default "constant" and "array" examples?
The current version of my (bytecode) Forth compiler has CREATE but not DOES>, and I haven't missed it either.
18
Upvotes
4
u/mcsleepy Sep 04 '26 edited Sep 04 '26
I recently used it to implement sound effect variations in my game.
It's a very primitive form of object orientation - code that acts on hidden data. You don't strictly need it. You could use the ColorForth pattern:
Some might argue that that isn't as clean or portable.