THEN: различия между версиями

Материал из ПМК вики
Перейти к навигации Перейти к поиску
Нет описания правки
Нет описания правки
Строка 48: Строка 48:
     THEN  is  the point where execution resumes after ELSE  or  IF
     THEN  is  the point where execution resumes after ELSE  or  IF
     (when no ELSE is present).
     (when no ELSE is present).
== THEN в fig-FORTH Release 1 glossary, май 1979 (англ.) ==
THEN                                        P,CO,L O
        An alias for ENDIF.
ENDIF        addr  n  ---  (compile)  P,CO,L0
        Occurs in a colon-definition in form:
          IF ... ENDIF
          IF ... ELSE ... ENDIF
        At run-time, ENDIF serves only as the destination of a forward
        branch from IF or ELSE. It marks the conclusion of the conditional
        structure. THEN is another name for ENDIF. Both names are supported
        in fig-FORTH. See also IF and ELSE.
        At compile-time, ENDIF computes the forward branch offset from addr
        to HERE and stores it at addr. n is used for error tests.





Версия от 20:44, 7 сентября 2015

THEN — стандартное слово Каллисто.

Конец ветвления "IF".


THEN в стандарте ANS Forth

6.1.2270   THEN                                                            CORE
       Интерпретация: Семантика интерпретации для этого слова не определена.
       Компиляция: ( C: orig -- )
           Добавляет семантику времени-выполнения, данную ниже к текущему 
           определению. Разрешает ссылку вперед orig, используя адрес ячейки 
           добавленной семантики времени-выполнения.
       Время-выполнения: ( -- )
           Продолжает выполнение.
       См.: 6.1.1310 ELSE, 6.1.1700 IF.
A.6.1.2270   THEN
Типичное использование:
       : X ... test IF ... THEN ... ;
или
       : X ... test IF ... ELSE ... THEN ... ;


THEN в предыдущем стандарте Forth-83 (англ.)

     THEN         --                            C,I,79
                  sys --   (compiling)
          Used in the form:
                  flag IF ... ELSE ... THEN
          or
                  flag IF ... THEN
          THEN is the point where execution continues after ELSE , or
          IF when no ELSE is present.  sys is balanced with its
          corresponding IF or ELSE .  See:  IF  ELSE


Пример реализации THEN из предыдущего стандарта Forth-83

          : THEN   >RESOLVE  ; IMMEDIATE


THEN в стандарте Forth-79 (англ.)

THEN                                         I,C,161
    Used in a colon-definition in the form:
         IF ... ELSE ... THEN   or
         IF ... THEN
    THEN  is  the point where execution resumes after ELSE  or  IF
    (when no ELSE is present).


THEN в fig-FORTH Release 1 glossary, май 1979 (англ.)

THEN                                        P,CO,L O
       An alias for ENDIF.
ENDIF         addr  n  ---  (compile)   P,CO,L0
       Occurs in a colon-definition in form:
         IF ... ENDIF
         IF ... ELSE ... ENDIF
       At run-time, ENDIF serves only as the destination of a forward
       branch from IF or ELSE. It marks the conclusion of the conditional
       structure. THEN is another name for ENDIF. Both names are supported
       in fig-FORTH. See also IF and ELSE.
       At compile-time, ENDIF computes the forward branch offset from addr
       to HERE and stores it at addr. n is used for error tests.


Ссылки


  У этой статьи нет иллюстраций. Вы можете помочь проекту, добавив их.


  Это заготовка статьи. Вы можете помочь проекту, дополнив её.