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

Материал из ПМК вики
Перейти к навигации Перейти к поиску
Нет описания правки
Нет описания правки
Строка 29: Строка 29:
  Типичное использование:
  Типичное использование:
         char WORD ccc<char>
         char WORD ccc<char>


== WORD в предыдущем стандарте Forth-83 (англ.) ==
== WORD в предыдущем стандарте Forth-83 (англ.) ==
Строка 53: Строка 52:
           dictionary area at HERE or above.  Note that the text
           dictionary area at HERE or above.  Note that the text
           interpreter may also use this area.  See:  "input stream"
           interpreter may also use this area.  See:  "input stream"


== WORD в стандарте Forth-79 (англ.) ==
== WORD в стандарте Forth-79 (англ.) ==
Строка 66: Строка 64:
     WORD is called,  then a zero length will result.  The address
     WORD is called,  then a zero length will result.  The address
     of the beginning of this packed string is left on the stack.
     of the beginning of this packed string is left on the stack.


== WORD в fig-FORTH Release 1 glossary, май 1979 (англ.) ==
== WORD в fig-FORTH Release 1 glossary, май 1979 (англ.) ==
Строка 78: Строка 75:
         otherwise from the disc block stored in BLK.
         otherwise from the disc block stored in BLK.
         See BLK, IN.
         See BLK, IN.


== Ссылки ==
== Ссылки ==
Строка 88: Строка 84:
{{заготовка}}
{{заготовка}}
[[Категория:Слова Каллисто]]
[[Категория:Слова Каллисто]]
[[Категория:Слова высокого уровня]]
[[Категория:Интерпретация входного потока Каллисто]]
[[Категория:Интерпретация входного потока Каллисто]]
[[Категория:Слова Каллисто без стековых диаграмм]]
[[Категория:Слова Каллисто без стековых диаграмм]]

Версия от 01:03, 20 марта 2016

WORD (слово, читается «ворд») — стандартное слово Каллисто.

Считывает одно слово из входного или экранного буфера и размещает его, начиная с адреса HERE

Ввод слова WORD

В режиме ЛАТ последовательно нажмите четыре клавиши  В↑   5   ×   K 

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

6.1.2450   WORD                                                            CORE
           ( char "<chars>ccc<char>" -- c-addr )
           Пропускает ведущие разделители. Выделяет символы ccc ограниченные 
           char. Неопределенная ситуация существует, если длина выделенной 
           строки больше чем длина определенной реализацией строки со 
           счетчиком.
           c-addr - адрес временной области, содержащей выделенное слово как 
           строку со счетчиком. Если область анализа была пуста или не 
           содержала других символов кроме разделителей, результирующая строка 
           имеет нулевую длину. За строкой следует не включенный в длину 
           пробел. Программа может изменять символы в пределах строки.
       Примечание: Требование, о следовании пробела за строкой устаревшее и 
           включено как уступка существующим программам, которые используют 
           CONVERT. Программа не должна зависеть от существования пробела.
       См.: 3.3.3.6 Другие временные области, 3.4.1 Синтаксический анализ.
A.6.1.2450   WORD
Типичное использование:
       char WORD ccc<char>

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

     WORD         char -- addr                  M,83
          Generates a counted string by non-destructively accepting
          characters from the input stream until the delimiting
          character char is encountered or the input stream is
          exhausted.  Leading delimiters are ignored.  The entire
          character string is stored in memory beginning at addr as a
          sequence of bytes.  The string is followed by a blank which
          is not included in the count.  The first byte of the string
          is the number of characters {0..255}.  If the string is
          longer than 255 characters, the count is unspecified.  If
          the input stream is already exhausted as WORD is called,
          then a zero length character string will result.
          If the delimiter is not found the value of >IN is the size
          of the input stream.  If the delimiter is found >IN is
          adjusted to indicate the offset to the character following
          the delimiter.  #TIB is unmodified.
          The counted string returned by WORD may reside in the "free"
          dictionary area at HERE or above.  Note that the text
          interpreter may also use this area.  See:  "input stream"

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

WORD           char -- addr                  181
    Receive  characters  from the input stream until the  non-zero
    delimiting  character  is encountered or the input  stream  is
    exhausted,  ignoring leading delimiters.   The characters  are
    stored  as  a  packed string with the character count  in  the
    first  character position.   The actual delimiter  encountered
    (char  or  null)  is stored at the end of  the  text  but  not
    included  in the count.   If the input stream was exhausted as
    WORD is called,  then a zero length will result.   The address
    of the beginning of this packed string is left on the stack.

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

WORD          c  ---                            L0
       Read the next text characters from the input stream being
       interpreted, until a delimiter c is found, storing the packed
       character string beginning at the dictionary buffer HERE. WORD
       leaves the character count in the first byte, the characters, and
       ends with two or more blanks. Leading occurrences of c are ignored.
       If BLK is zero text is taken from the terminal input buffer,
       otherwise from the disc block stored in BLK.
       See BLK, IN.

Ссылки


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


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