Liste des Groupes | Revenir à cu programmer |
On Wed, 17 Apr 2024 21:52:06 +0200
David Brown <david.brown@hesbynett.no> wrote:
>I think that when finding the definition of a word, Forth just>
searches back through the stack of definitions until it gets a hit.
And if that word definition uses other non-primitive words, it goes
backwards from where it currently is, looking only at definitions
from before the current word was defined. Is that right? And if so,
can you do "forward declarations", and mutual recursion somehow?
That's my understanding, yes; essentially, it's a consequence of the
fact that definitions are stored as a list of pointers, and re-
definitions are simply appended to the dictionary without going back
through the rest of it to update any pointers to the prior definition.
A strange design choice, but they're consistent with it.
Les messages affichés proviennent d'usenet.