What are any inevitable use-cases of the unindexable array in Forth?
nine_k•54m ago
An "unindexed array" is basically `char *` in C; the use cases are the same, I suppose.
astrobe_•46m ago
There's none. It's kind of like the "hello world" or "empty program" example for arrays.
What this page shows is that the CREATE ... DOES> construct is similar to a closure, except it can only capture one address (or reference in languages that don't want you to dirty your hands with addresses ;-) and it is always a global symbol (like almost always in Forth). It is still useful to encapsulate implementation details, though.
Some people have said it is a basis for objects, which is a bit euphoric IMHO. You know, "closures are the poor man's objects, and objects are the poor man's closures".
eimrine•1h ago
nine_k•54m ago
astrobe_•46m ago
What this page shows is that the CREATE ... DOES> construct is similar to a closure, except it can only capture one address (or reference in languages that don't want you to dirty your hands with addresses ;-) and it is always a global symbol (like almost always in Forth). It is still useful to encapsulate implementation details, though. Some people have said it is a basis for objects, which is a bit euphoric IMHO. You know, "closures are the poor man's objects, and objects are the poor man's closures".