ANS Forth 中的 'tick' 发生了什么?
What has happened to 'tick' in ANS Forth?
正如我记得 'tick' 来自 FIG-Forth 的那样,当单词不在单词列表中时,它可以在不流产的情况下使用:
' the_word
如果单词在单词列表中,则给出对该单词的引用,否则给出 'false'。
是否可以在 ANS Forth 中构造类似的东西以与 [if]、[then] 和 [else] 一起使用?
我猜是这样的:
: tick ( a u -- xt|f ) bl word find 0= if drop 0 then ;
FIG-Forth 文档说:
Leaves the parameter field address of dictionary word nnnn. As a
compiler directive, executes in a colon-definition to compile the
address as a literal. If the word is not found after a search of
CONTEXT and CURRENT, an appropriate error message is given.
虽然完全有可能FIG-Forth你使用的版本不符合标准,返回false。
正如我记得 'tick' 来自 FIG-Forth 的那样,当单词不在单词列表中时,它可以在不流产的情况下使用:
' the_word
如果单词在单词列表中,则给出对该单词的引用,否则给出 'false'。
是否可以在 ANS Forth 中构造类似的东西以与 [if]、[then] 和 [else] 一起使用?
我猜是这样的:
: tick ( a u -- xt|f ) bl word find 0= if drop 0 then ;
FIG-Forth 文档说:
Leaves the parameter field address of dictionary word nnnn. As a compiler directive, executes in a colon-definition to compile the address as a literal. If the word is not found after a search of CONTEXT and CURRENT, an appropriate error message is given.
虽然完全有可能FIG-Forth你使用的版本不符合标准,返回false。