Loading file.tex +27 −24 Original line number Diff line number Diff line Loading @@ -110,12 +110,12 @@ The File-Access word set creates another input source for the text interpreter. When the input source is a text file, \word[block]{BLK} shall contain zero, \word{SOURCE-ID} shall contain the \emph{fileid} of that text file, and the input buffer shall contain one line of the text file. \place{x:source-id}{During text interpretation from a text file, the the text file. During text interpretation from a text file, the value returned by \word{FILE-POSITION} for the \param{fileid} returned by \word{SOURCE-ID} is not defined. A standard program may not call by \word{SOURCE-ID} is \replace{ed12}{not defined}{undefined}. A standard program \replace{ed12}{may}{shall} not call \word{REPOSITION-FILE} on the \param{fileid} returned by \word{SOURCE-ID}.} \word{SOURCE-ID}. Input with \word{INCLUDED}, \word{INCLUDE-FILE}, \word[block]{LOAD} and \word[block]{EVALUATE} shall be nestable in any order to at least Loading Loading @@ -237,8 +237,8 @@ See: \xref[3.4.1 Parsing]{usage:parsing}. \section{Compliance and labeling} % 11.5 \cbstart\patch{F94} \subsection[Forth systems]{ANS\strike{3.5}{25} Forth systems} % 11.5.1 \cbstart\patch{F12} \subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 11.5.1 \cbend The phrase ``Providing the File Access word set'' shall be appended Loading @@ -253,8 +253,8 @@ The phrase ``Providing the File Access Extensions word set'' shall be appended to the label of any Standard System that provides all of the File Access and File Access Extensions word sets. \cbstart\patch{F94} \subsection[Forth programs]{ANS\strike{3.5}{25} Forth programs} % 11.5.2 \cbstart\patch{F12} \subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 11.5.2 \cbend The phrase ``Requiring the File Access word set'' shall be appended Loading Loading @@ -314,12 +314,13 @@ provide all of the File Access and File Access Extensions word sets. The arguments to \word{READ-FILE} and \word{WRITE-FILE} are arrays of character storage elements, each element consisting of at least 8 bits. The Technical Committee intends that, in of at least 8 bits. The \remove{ed12}{Technical} Committee intends that, in \word{BIN} mode, the contents of these storage elements can be written to a file and later read back without alteration. The written to a file and later read back without alteration. \remove{ed12}{The Technical Committee has declined to address issues regarding the impact of ``wide'' characters on the File and Block word sets. sets.} \end{rationale} \end{worddef} Loading Loading @@ -622,7 +623,7 @@ provide all of the File Access and File Access Extensions word sets. \end{quote}\setwordlist{file} In this example, \word[exception]{THROW} is used to handle (unexpected) exception conditions, which are reported as \remove{ed12}{(unexpected)} exception conditions, which are reported as non-zero values of the \param{ior} return value from \word{READ-FILE}. End-of-file is reported as a zero value of the ``length'' return value. Loading Loading @@ -696,10 +697,11 @@ provide all of the File Access and File Access Extensions word sets. \end{tabbing} \end{quote}\setwordlist{file} \remove{ed12}{% In this example, \word[exception]{THROW} is used to handle (unexpected) I/O exception condition, which are reported as non-zero values of the ``\param{ior}'' return value from \word{READ-LINE}. non-zero values of the ``\emph{ior}'' return value from \word{READ-LINE}.} \word{READ-LINE} needs a separate end-of-file flag because empty (zero-length) lines are a routine occurrence, so a Loading Loading @@ -857,10 +859,11 @@ provide all of the File Access and File Access Extensions word sets. prudent to copy the string to a ``safe'' buffer allocated by the application. \remove{ed12}{% Programs wishing to parse in the fashion of \word{Sq} are advised to use \word[core]{PARSE} or \word[core]{WORD} \word[core]{COUNT} instead of \word{Sq}, preventing the overwriting of the interpreted string buffer. overwriting of the interpreted string buffer.} \end{rationale} \end{worddef} Loading Loading @@ -971,7 +974,7 @@ provide all of the File Access and File Access Extensions word sets. \end{worddef} \begin{worddef}{}{INCLUDE}[][X:required] \begin{worddef}{1714}{INCLUDE}[][X:required] \item \stack{i*x "name"}{j*x} Skip leading white space and parse \param{name} delimited by a Loading @@ -990,7 +993,7 @@ provide all of the File Access and File Access Extensions word sets. \end{rationale} \begin{implement} % I.11.6.2.---- INCLUDE \word{:} INCLUDE \word{p} i*x "name" -{}- j*x ) \\ \word{:} \word{INCLUDE} \word{p} i*x "name" -{}- j*x ) \\ \tab \word{PARSE-NAME} \word{INCLUDED} \word{;} \end{implement} Loading Loading @@ -1044,7 +1047,7 @@ provide all of the File Access and File Access Extensions word sets. \end{worddef} \begin{worddef}{}{REQUIRE}[][X:required] \begin{worddef}{2144}[10]{REQUIRE}[][X:required] \item \stack{i*x "name"}{i*x} Skip leading white space and parse \param{name} delimited by a Loading @@ -1063,7 +1066,7 @@ provide all of the File Access and File Access Extensions word sets. \end{rationale} \begin{implement} % I.11.6.2.---- REQUIRE \word{:} REQUIRE \word{p} i*x "name" -{}- i*x ) \\ \word{:} \word{REQUIRE} \word{p} i*x "name" -{}- i*x ) \\ \tab \word{PARSE-NAME} \word{REQUIRED} \word{;} \end{implement} Loading @@ -1073,7 +1076,7 @@ provide all of the File Access and File Access Extensions word sets. \end{worddef} \begin{worddef}{}{REQUIRED}[][X:required] \begin{worddef}{2144}[50]{REQUIRED}[][X:required] \item \stack{i*x c-addr u}{i*x} If the file specified by \param{c-addr u} has been \word{INCLUDED} Loading Loading @@ -1119,7 +1122,7 @@ provide all of the File Access and File Access Extensions word sets. \ttfamily \word{:} save-mem \word{p} addr1 u -{}- addr2 u ) \word{bs} gforth \\ \word{bs} copy a memory block into a newly allocated region in the heap \\ \word{bs} \textdf{copy a memory block into a newly allocated region in the heap} \\ \tab \word{SWAP} \word{toR} \\ \tab \word{DUP} \word[memory]{ALLOCATE} \word[exception]{THROW} \\ \tab \word{SWAP} \word{2DUP} \word{Rfrom} \word{ROT} \word{ROT} \word{MOVE} \word{;} \\ Loading @@ -1127,8 +1130,8 @@ provide all of the File Access and File Access Extensions word sets. \word{:} name-add \word{p} addr u listp -{}- ) \\ \tab \word{toR} save-mem \word{p} addr1 u ) \\ \tab 3 \word{CELLS} \word[memory]{ALLOCATE} \word[exception]{THROW} \word{bs} allocate list node \\ \tab \word{R@} \word{@} \word{OVER} \word{!} \word{bs} set next pointer \\ \tab \word{DUP} \word{Rfrom} \word{!} \word{bs} store current node in list var \\ \tab \word{R@} \word{@} \word{OVER} \word{!} \word{bs} \textdf{set next pointer} \\ \tab \word{DUP} \word{Rfrom} \word{!} \word{bs} \textdf{store current node in list var} \\ \tab \word{CELL+} \word{2!} \word{;} \\ \word{:} name-present? \word{p} addr u list -{}- f ) \\ Loading @@ -1155,7 +1158,7 @@ provide all of the File Access and File Access Extensions word sets. \tab \word{2DUP} included-names name-join \\ \tab \word{INCLUDED} \word{;} \\ \word{:} REQUIRED \word{p} i*x addr u -{}- i*x ) \\ \word{:} \word{REQUIRED} \word{p} i*x addr u -{}- i*x ) \\ \tab \word{2DUP} included-names \word{@} name-present? \word{0=} \word{IF} \\ \tab[2] included \\ \tab \word{ELSE} \\ Loading Loading
file.tex +27 −24 Original line number Diff line number Diff line Loading @@ -110,12 +110,12 @@ The File-Access word set creates another input source for the text interpreter. When the input source is a text file, \word[block]{BLK} shall contain zero, \word{SOURCE-ID} shall contain the \emph{fileid} of that text file, and the input buffer shall contain one line of the text file. \place{x:source-id}{During text interpretation from a text file, the the text file. During text interpretation from a text file, the value returned by \word{FILE-POSITION} for the \param{fileid} returned by \word{SOURCE-ID} is not defined. A standard program may not call by \word{SOURCE-ID} is \replace{ed12}{not defined}{undefined}. A standard program \replace{ed12}{may}{shall} not call \word{REPOSITION-FILE} on the \param{fileid} returned by \word{SOURCE-ID}.} \word{SOURCE-ID}. Input with \word{INCLUDED}, \word{INCLUDE-FILE}, \word[block]{LOAD} and \word[block]{EVALUATE} shall be nestable in any order to at least Loading Loading @@ -237,8 +237,8 @@ See: \xref[3.4.1 Parsing]{usage:parsing}. \section{Compliance and labeling} % 11.5 \cbstart\patch{F94} \subsection[Forth systems]{ANS\strike{3.5}{25} Forth systems} % 11.5.1 \cbstart\patch{F12} \subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 11.5.1 \cbend The phrase ``Providing the File Access word set'' shall be appended Loading @@ -253,8 +253,8 @@ The phrase ``Providing the File Access Extensions word set'' shall be appended to the label of any Standard System that provides all of the File Access and File Access Extensions word sets. \cbstart\patch{F94} \subsection[Forth programs]{ANS\strike{3.5}{25} Forth programs} % 11.5.2 \cbstart\patch{F12} \subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 11.5.2 \cbend The phrase ``Requiring the File Access word set'' shall be appended Loading Loading @@ -314,12 +314,13 @@ provide all of the File Access and File Access Extensions word sets. The arguments to \word{READ-FILE} and \word{WRITE-FILE} are arrays of character storage elements, each element consisting of at least 8 bits. The Technical Committee intends that, in of at least 8 bits. The \remove{ed12}{Technical} Committee intends that, in \word{BIN} mode, the contents of these storage elements can be written to a file and later read back without alteration. The written to a file and later read back without alteration. \remove{ed12}{The Technical Committee has declined to address issues regarding the impact of ``wide'' characters on the File and Block word sets. sets.} \end{rationale} \end{worddef} Loading Loading @@ -622,7 +623,7 @@ provide all of the File Access and File Access Extensions word sets. \end{quote}\setwordlist{file} In this example, \word[exception]{THROW} is used to handle (unexpected) exception conditions, which are reported as \remove{ed12}{(unexpected)} exception conditions, which are reported as non-zero values of the \param{ior} return value from \word{READ-FILE}. End-of-file is reported as a zero value of the ``length'' return value. Loading Loading @@ -696,10 +697,11 @@ provide all of the File Access and File Access Extensions word sets. \end{tabbing} \end{quote}\setwordlist{file} \remove{ed12}{% In this example, \word[exception]{THROW} is used to handle (unexpected) I/O exception condition, which are reported as non-zero values of the ``\param{ior}'' return value from \word{READ-LINE}. non-zero values of the ``\emph{ior}'' return value from \word{READ-LINE}.} \word{READ-LINE} needs a separate end-of-file flag because empty (zero-length) lines are a routine occurrence, so a Loading Loading @@ -857,10 +859,11 @@ provide all of the File Access and File Access Extensions word sets. prudent to copy the string to a ``safe'' buffer allocated by the application. \remove{ed12}{% Programs wishing to parse in the fashion of \word{Sq} are advised to use \word[core]{PARSE} or \word[core]{WORD} \word[core]{COUNT} instead of \word{Sq}, preventing the overwriting of the interpreted string buffer. overwriting of the interpreted string buffer.} \end{rationale} \end{worddef} Loading Loading @@ -971,7 +974,7 @@ provide all of the File Access and File Access Extensions word sets. \end{worddef} \begin{worddef}{}{INCLUDE}[][X:required] \begin{worddef}{1714}{INCLUDE}[][X:required] \item \stack{i*x "name"}{j*x} Skip leading white space and parse \param{name} delimited by a Loading @@ -990,7 +993,7 @@ provide all of the File Access and File Access Extensions word sets. \end{rationale} \begin{implement} % I.11.6.2.---- INCLUDE \word{:} INCLUDE \word{p} i*x "name" -{}- j*x ) \\ \word{:} \word{INCLUDE} \word{p} i*x "name" -{}- j*x ) \\ \tab \word{PARSE-NAME} \word{INCLUDED} \word{;} \end{implement} Loading Loading @@ -1044,7 +1047,7 @@ provide all of the File Access and File Access Extensions word sets. \end{worddef} \begin{worddef}{}{REQUIRE}[][X:required] \begin{worddef}{2144}[10]{REQUIRE}[][X:required] \item \stack{i*x "name"}{i*x} Skip leading white space and parse \param{name} delimited by a Loading @@ -1063,7 +1066,7 @@ provide all of the File Access and File Access Extensions word sets. \end{rationale} \begin{implement} % I.11.6.2.---- REQUIRE \word{:} REQUIRE \word{p} i*x "name" -{}- i*x ) \\ \word{:} \word{REQUIRE} \word{p} i*x "name" -{}- i*x ) \\ \tab \word{PARSE-NAME} \word{REQUIRED} \word{;} \end{implement} Loading @@ -1073,7 +1076,7 @@ provide all of the File Access and File Access Extensions word sets. \end{worddef} \begin{worddef}{}{REQUIRED}[][X:required] \begin{worddef}{2144}[50]{REQUIRED}[][X:required] \item \stack{i*x c-addr u}{i*x} If the file specified by \param{c-addr u} has been \word{INCLUDED} Loading Loading @@ -1119,7 +1122,7 @@ provide all of the File Access and File Access Extensions word sets. \ttfamily \word{:} save-mem \word{p} addr1 u -{}- addr2 u ) \word{bs} gforth \\ \word{bs} copy a memory block into a newly allocated region in the heap \\ \word{bs} \textdf{copy a memory block into a newly allocated region in the heap} \\ \tab \word{SWAP} \word{toR} \\ \tab \word{DUP} \word[memory]{ALLOCATE} \word[exception]{THROW} \\ \tab \word{SWAP} \word{2DUP} \word{Rfrom} \word{ROT} \word{ROT} \word{MOVE} \word{;} \\ Loading @@ -1127,8 +1130,8 @@ provide all of the File Access and File Access Extensions word sets. \word{:} name-add \word{p} addr u listp -{}- ) \\ \tab \word{toR} save-mem \word{p} addr1 u ) \\ \tab 3 \word{CELLS} \word[memory]{ALLOCATE} \word[exception]{THROW} \word{bs} allocate list node \\ \tab \word{R@} \word{@} \word{OVER} \word{!} \word{bs} set next pointer \\ \tab \word{DUP} \word{Rfrom} \word{!} \word{bs} store current node in list var \\ \tab \word{R@} \word{@} \word{OVER} \word{!} \word{bs} \textdf{set next pointer} \\ \tab \word{DUP} \word{Rfrom} \word{!} \word{bs} \textdf{store current node in list var} \\ \tab \word{CELL+} \word{2!} \word{;} \\ \word{:} name-present? \word{p} addr u list -{}- f ) \\ Loading @@ -1155,7 +1158,7 @@ provide all of the File Access and File Access Extensions word sets. \tab \word{2DUP} included-names name-join \\ \tab \word{INCLUDED} \word{;} \\ \word{:} REQUIRED \word{p} i*x addr u -{}- i*x ) \\ \word{:} \word{REQUIRED} \word{p} i*x addr u -{}- i*x ) \\ \tab \word{2DUP} included-names \word{@} name-present? \word{0=} \word{IF} \\ \tab[2] included \\ \tab \word{ELSE} \\ Loading