NAME>INTERPRET

( nt -- xt | 0 )

xt represents the interpretation semantics of the word nt. If nt has no interpretation semantics, NAME>INTERPRET returns 0.

Note:

This standard does not define the interpretation semantics of some words, but systems are allowed to do so.

See:

ContributeContributions

JennyBrienavatar of JennyBrien How can the zero result be used in a Standard program?Request for clarification2019-07-02 10:29:22

AntonErtlavatar of AntonErtl

For a standard program, this is usually a restriction rather than an entitlement: It has to cope with the possibility of NAME>INTERPRET returning 0. Anyway, here is an example of how to deal with that: A user-defined text interpreter:

... parse-name 2dup find-name if nip nip
  state @ if
    name>compile
  else
    name>interpret dup 0= -14 and throw
  then
  execute
else
  ... deal with numbers
then

JennyBrienavatar of JennyBrien

My point is that this would only be useful in a system that has some way to explicitly mark definitions as having no interpretation semantics.

AntonErtlavatar of AntonErtl

The standard defines words with undefined interpretation semantics, and some systems implement this in some way; that's the reason for allowing NAME>INTERPRET to return 0. If you know your system never returns 0 from NAME>INTERPRET, you do not need to write the program in that way, but for portable programs, you have to take this possibility into account.

Reply New Version

ruvavatar of ruv NAME>INTERPRET wordingProposal2020-02-20 09:55:14

This contribution has been moved to the proposal section.

ruvavatar of ruv

This reply has been moved to the proposal section.

AntonErtlavatar of AntonErtl

This reply has been moved to the proposal section.
Reply New Version