Digest #282 2024-09-24

Contributions

[364] 2024-09-23 15:52:38 ruv wrote:

requestClarification - How to perform the interpretation semantics for a word

The specification for name>interpret ( nt -- xt|0 ) says that "xt represents the interpretation semantics for the word nt".

The question is: having the nt of a word, how can we perform the same behavior that the Forth system exhibits when the Forth text interpreter encounters the name of the word identified by this nt in interpretation state?

To avoid confusing, in this topic I will refer to this behavior as observable interpretation semantics, and to the corresponding behavior in compilation state as observable compilation semantics.

In practice, when we need to perform some semantics of a word from its nt, we need to perform one of the following for this word:

  • the observable interpretation semantics regardless the current STATE;
  • the observable compilation semantics regardless the current STATE;
  • the observable interpretation semantics if the system in interpretation state, or the observable compilation semantics if the system in compilation state;
  • the execution semantics.

It seems like there are no other options at all. Isn't that right?

If the standard does not define some semantics, we want to perform what the Forth system defines (if any).

The name name>interpret gives the impression that this word should help us to perform the observable interpretation semantics of the word. But the specification does not say anything on this.

So, I am asking this in order to reach a consensus on this question: how to perform the observable interpretation semantics of a word identified by its nt regardless whether the Forth system in interpretation state or in compilation state? What do you think?