COMPILE
COMPILE (компилировать, скомпилировать) — стандартное слово Каллисто.
Компиляция 16-битного слова, следующего за оператором.
Слово COMPILE компилирует (т.е. добавляет) на вершину словаря значение, находящееся в шитом коде непосредственно за данной ссылкой на статью COMPILE.
COMPILE в предыдущем стандарте Forth-83 (англ.)
COMPILE -- C,83 Typically used in the form: : <name> ... COMPILE <namex> ... ; When <name> is executed, the compilation address compiled for <namex> is compiled and not executed. <name> is typically immediate and <namex> is typically not immediate. See: "compilation"
COMPILE в стандарте Forth-79 (англ.)
COMPILE C,146 When a word containing COMPILE executes, the 16-bit value following the compilation address of COMPILE is copied (compiled) into the dictionary. i.e., COMPILE DUP will copy the compilation address of DUP. COMPILE [ 0 , ] will copy zero.
COMPILE в fig-FORTH Release 1 glossary, май 1979 (англ.)
COMPILE C2 When the word containing COMPILE executes, the execution address of the word following COMPILE is copied (compiled) into the dictionary. This allows specific compilation situations to be handled in addition to simply compiling an execution address (which the interpreter already does).
Реализация COMPILE
Юрий Семёнов приводит следующее описание слова COMPILE (стр. 140):
: COMPILE ?COMP I R> 2+ >R @ , ;
У Баранова-Ноздрунова приводится следующее описание слова COMPILE (стр. 54):
: COMPILE ( ---> ) I @ , R> 2+ >R ;
История
Слово из стандарта Forth 83. Было исключено из стандарта ANS Forth в пользу слова POSTPONE.
У этой статьи нет иллюстраций. Вы можете помочь проекту, добавив их. |
Это заготовка статьи. Вы можете помочь проекту, дополнив её. |