Commit fd589204 authored by pknaggs's avatar pknaggs

Remove 12.1 and 12.2 markup

Added 13.1 markup
parent 5ddf0fa4
......@@ -49,12 +49,12 @@ set and glossary section in which the word is defined.
%
% Standard Extension Proposal
%
% \ifdraft
\ifrelease\else
\def\Tmp{#7}%
\ifx\Tmp\empty\else
\marginpar{\textsf{\tiny #7}}
\fi%
% \fi%
\fi%
%
% Word Label - If we are showing reference
%
......
......@@ -130,9 +130,7 @@ See: \xref[3.4.4 Possible action on an ambiguous condition]{usage:ambiguous}.
\section{Compliance and labeling} % 7.5
\cbstart\patch{F12}
\subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 7.5.1
\cbend
\subsection{Forth-\snapshot{} systems} % 7.5.1
The phrase ``Providing the Block word set'' shall be appended to
the label of any Standard System that provides all of the Block
......@@ -146,9 +144,7 @@ The phrase ``Providing the Block Extensions word set'' shall be
appended to the label of any Standard System that provides all of
the Block and Block Extensions word sets.
\cbstart\patch{F12}
\subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 7.5.2
\cbend
\subsection{Forth-\snapshot{} programs} % 7.5.2
The phrase ``Requiring the Block word set'' shall be appended to
the label of Standard Programs that require the system to provide
......@@ -269,6 +265,7 @@ to provide all of the Block and Block Extensions word sets.
\end{worddef}
\pagebreak
\begin{worddef}{2180}{SAVE-BUFFERS}
\item \stack{}{}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,7 +13,7 @@ and reasons why this is so.
The implementation-defined items in the following list represent
characteristics and choices left to the discretion of the
implementor, provided that the requirements of this Standard are
implementor, provided that the requirements of this standard are
met. A system shall document the values for, or behaviors of, each
item.
......@@ -127,7 +127,7 @@ item.
A system shall document the system action taken upon each of the
general or specific ambiguous conditions identified in this
Standard. See \xref[Possible actions on an ambiguous condition]{usage:ambiguous}.
standard. See \xref[Possible actions on an ambiguous condition]{usage:ambiguous}.
The following general ambiguous conditions could occur because of a
combination of factors:
......
% !TeX root = forth.tex
\chapter{The optional Double-Number word set} % 8
\wordlist{double}
......@@ -62,9 +63,7 @@ See: \xref[3.4.1.3 Text interpreter input number conversion]{usage:numbers}.
\section{Compliance and labeling} % 8.5
\cbstart\patch{F12}
\subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 8.5.1
\cbend
\subsection{Forth-\snapshot{} systems} % 8.5.1
The phrase ``Providing the Double-Number word set'' shall be
appended to the label of any Standard System that provides all
......@@ -80,9 +79,7 @@ shall be appended to the label of any Standard System that
provides all of the Double-Number and Double-Number Extensions
word sets.
\cbstart\patch{F12}
\subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 8.5.2
\cbend
\subsection{Forth-\snapshot{} programs} % 8.5.2
The phrase ``Requiring the Double-Number word set'' shall be
appended to the label of Standard Programs that require the
......@@ -135,6 +132,9 @@ Extensions word sets.
\test{\word{:} cd2 \word{2CONSTANT} \word{;}}{} \\
\test{-1 -2 cd2 2c2}{} \\
\test{2c2}{-1 -2}
\test{4 5 \word{2CONSTANT} 2c3 \word{IMMEDIATE} 2c3}{4 5} \\
\test{\word{:} cd6 2c3 \word{2LITERAL} \word{;} cd6}{4 5}
\end{testing}
\end{worddef}
......@@ -167,6 +167,10 @@ Extensions word sets.
\begin{testing}
\test{\word{:} cd1 \word{[} MAX-2INT \word{]} \word{2LITERAL} \word{;}}{}\\
\test{cd1}{MAX-2INT}
\test{\word{2VARIABLE} 2v4 \word{IMMEDIATE} 5 6 2v4 \word{2!}}{} \\
\test{\word{:} cd7 2v4 \word{[} \word{2@} \word{]} \word{2LITERAL} \word{;} cd7}{5 6} \\
\test{\word{:} cd8 \word{[} 6 7 \word{]} 2v4 \word{[} \word{2!} \word{]} \word{;} 2v4 \word{2@}}{6 7}
\end{testing}
\end{worddef}
......@@ -210,6 +214,9 @@ Extensions word sets.
\test{\word{:} cd3 2v2 \word{2!} \word{;}}{} \\
\test{-2 -1 cd3}{} \\
\test{2v2 \word{2@}}{-2 -1}
\test{\word{2VARIABLE} 2v3 \word{IMMEDIATE} 5 6 2v3 \word{2!}}{} \\
\test{2v3 \word{2@}}{5 6}
\end{testing}
\end{worddef}
......@@ -387,8 +394,6 @@ Extensions word sets.
toward the most-significant bit, filling the vacated
least-significant bit with zero.
\see \rref{core:2*}{}.
\begin{testing}
\test{ 0. \word{D2*}}{0. \word{D2*}} \\
\test{MIN-INT 0 \word{D2*}}{0 1} \\
......@@ -405,8 +410,6 @@ Extensions word sets.
toward the least-significant bit, leaving the most-significant
bit unchanged.
\see \rref{core:2/}{}.
\begin{testing}
\test{ 0. \word{D2/}}{0. } \\
\test{ 1. \word{D2/}}{0. } \\
......
......@@ -13,15 +13,16 @@ None.
\label{exception:throw}
The \word{THROW} values \{-255{\ldots}-1\} shall be used only as
assigned by this Standard. The values \{-4095{\ldots}-256\}
assigned by this standard. The values \{-4095{\ldots}-256\}
shall be used only as assigned by a system.
\remove{x:throw-iors}{%
If the File-Access or Memory-Allocation word sets are implemented,
it is recommended that the non-zero values of \emph{ior} lie within
the range of system \word{THROW} values, as defined above. In an
operating-system environment, this can sometimes be accomplished
by ``biasing'' the range of operating-system exception codes to fall
within the \word{THROW} range.
within the \word{THROW} range.}
Programs shall not define values for use with \word{THROW} in the
range \{-4095{\ldots}-1\}.
......@@ -162,8 +163,8 @@ See: \xref[3.4.4 Possible actions on an ambiguous condition]{usage:ambiguous}.
\throwdef{-75}{\word[file]{WRITE-FILE}}
\throwdef{-76}{\word[file]{WRITE-LINE}}
\throwdef{-77}{Malformed xchar}
\throwdef[substitute]{-78}{\word[string]{SUBSTITUTE}}
\throwdef[substitute]{-79}{\word[string]{REPLACES}}
\throwdef{-78}{\word[string]{SUBSTITUTE}}
\throwdef{-79}{\word[string]{REPLACES}}
\end{minipage}
\\[-2ex] \hline\hline
\end{tabular}
......@@ -214,9 +215,7 @@ state for continued execution past the \word{CATCH}.
\section{Compliance and labeling} % 9.5
\cbstart\patch{F12}
\subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 9.5.1
\cbend
\subsection{Forth-\snapshot{} systems} % 9.5.1
The phrase ``Providing the Exception word set'' shall be appended to
the label of any Standard System that provides all of the Exception
......@@ -230,9 +229,7 @@ The phrase ``Providing the Exception Extensions word set'' shall be
appended to the label of any Standard System that provides all of
the Exception and Exception Extensions word sets.
\cbstart\patch{F12}
\subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 9.5.2
\cbend
\subsection{Forth-\snapshot{} programs} % 9.5.2
The phrase ``Requiring the Exception word set'' shall be appended
to the label of Standard Programs that require the system to provide
......@@ -272,58 +269,54 @@ to provide all of the Exception and Exception Extensions word sets.
\begin{implement} % I.9.1.0875 CATCH
\dffamily
\cbstart\patch{ed12}
\uline{%
This sample implementation of \word{CATCH} uses the non-standard
words described below. They or their equivalents are available in many
systems. Other implementation strategies, including directly saving the
value of \word[core]{DEPTH}, are possible if such words are not available.}
value of \word[core]{DEPTH}, are possible if such words are not available.
\begin{quote}
\uline{\texttt{SP@}} \stack{}{\uline{addr}}
\uline{returns the address corresponding to the top of data stack.}
\begin{description}
\item[\texttt{SP@}] \stack{}{addr} \\
returns the address corresponding to the top of data stack.
\uline{\texttt{SP!}} \stack{\uline{addr}}{}
\uline{sets the stack pointer to \emph{addr}, thus restoring the stack
\item[\texttt{SP!}] \stack{addr}{} \\
sets the stack pointer to \emph{addr}, thus restoring the stack
depth to the same depth that existed just before \emph{addr} was
acquired by executing \texttt{SP@}.}
acquired by executing \texttt{SP@}.
\uline{\texttt{RP@}} \stack{}{\uline{addr}}
\uline{returns the address corresponding to the top of return stack.}
\item[\texttt{RP@}] \stack{}{addr} \\
returns the address corresponding to the top of return stack.
\uline{\texttt{RP!}} \stack{\uline{addr}}{}
\uline{sets the return stack pointer to \emph{addr}, thus restoring the
\item[\texttt{RP!}] \stack{addr}{} \\
sets the return stack pointer to \emph{addr}, thus restoring the
return stack depth to the same depth that existed just before
\emph{addr} was acquired by executing \texttt{RP@}.}
\end{quote}
\emph{addr} was acquired by executing \texttt{RP@}.
\end{description}
\ttfamily
\begin{tabbing}
\tab \= \tab \= \hspace{7em} \= ( saved-sp ) \= \kill
\uline{\word{VARIABLE} HANDLER ~ 0 HANDLER \word{!}} ~ \uline{\word{bs} \textdf{last exception handler}} \\[\parskip]
\+ \uline{\word{:} \word{CATCH} ~ \word{p} xt -{}- exception\# | 0 )} \uline{\word{bs} \textdf{return addr on stack}} \\
\uline{SP@ \word{toR}} \>\> \uline{\word{p} xt )}\> \uline{\word{bs} \textdf{save data stack pointer}} \\
\uline{HANDLER \word{@} \word{toR}} \>\> \uline{\word{p} xt )}\> \uline{\word{bs} \textdf{and previous handler}} \\
\uline{RP@ HANDLER \word{!}} \>\> \uline{\word{p} xt )}\> \uline{\word{bs} \textdf{set current handler}} \\
\uline{\word{EXECUTE}} \>\> \uline{\word{p} )} \> \uline{\word{bs} \textdf{execute returns if no} THROW} \\
\uline{\word{Rfrom} HANDLER \word{!}} \>\> \uline{\word{p} )} \> \uline{\word{bs} \textdf{restore previous handler}} \\
\uline{\word{Rfrom} \word{DROP}} \>\> \uline{\word{p} )} \> \uline{\word{bs} \textdf{discard saved stack ptr}} \\
\- \uline{0} \>\> \uline{\word{p} 0 )} \> \uline{\word{bs} \textdf{normal completion}} \\
\uline{\word{;}}
\word{VARIABLE} HANDLER ~ 0 HANDLER \word{!} ~ \word{bs} \textdf{last exception handler} \\[\parskip]
\+ \word{:} \word{CATCH} ~ \word{p} xt -{}- exception\# | 0 \word{bs} \textdf{return addr on stack} \\
SP@ \word{toR} \>\> \word{p} xt )\> \word{bs} \textdf{save data stack pointer} \\
HANDLER \word{@} \word{toR} \>\> \word{p} xt )\> \word{bs} \textdf{and previous handler} \\
RP@ HANDLER \word{!} \>\> \word{p} xt )\> \word{bs} \textdf{set current handler} \\
\word{EXECUTE} \>\> \word{p} ) \> \word{bs} \textdf{execute returns if no} THROW \\
\word{Rfrom} HANDLER \word{!} \>\> \word{p} ) \> \word{bs} \textdf{restore previous handler} \\
\word{Rfrom} \word{DROP} \>\> \word{p} ) \> \word{bs} \textdf{discard saved stack ptr} \\
\- 0 \>\> \word{p} 0 ) \> \word{bs} \textdf{normal completion} \\
\word{;}
\end{tabbing}
\uline{%
\dffamily
In a multi-tasking system, the \texttt{HANDLER} variable should be in
the per-task variable area (i.e., a user variable).}
the per-task variable area (i.e., a user variable).
\uline{%
This sample implementation does not explicitly handle the case in
which \word{CATCH} has never been called (i.e., the \word{ABORT}
behavior). One solution would be to execute a \word{CATCH} within
\word{QUIT}, so that there is always an ``exception handler of last
resort'' present, as shown in \iref{core:QUIT}{}.}
\cbend
resort'' present, as shown in \iref{core:QUIT}{}.
\end{implement}
\begin{testing}
......@@ -339,7 +332,7 @@ to provide all of the Exception and Exception Extensions word sets.
frame from the exception stack, along with everything on the
return stack above that frame. Then restore the input source
specification in use before the corresponding \word{CATCH}
and adjust the depths of all stacks defined by this Standard
and adjust the depths of all stacks defined by this standard
so that they are the same as the depths saved in the exception
frame (\param{i} is the same number as the \param{i} in the input
arguments to the corresponding \word{CATCH}), put \param{n} on
......@@ -412,24 +405,22 @@ to provide all of the Exception and Exception Extensions word sets.
\end{rationale}
\begin{implement}
\cbstart\patch{ed12}
\uline{\textdf{This is the counter part to \iref{exception:CATCH}{}.}}
\textdf{This is the counter part to \iref{exception:CATCH}{}.}
\begin{tabbing}
\tab \= \tab \= \hspace{7em} \= ( saved-sp ) \= \kill
\+ \uline{\word{:} \word{THROW}} \uline{\word{p} ??? exception\# -{}- ??? exception\# )} \\
\+ \uline{\word{qDUP} \word{IF}} \> \> \uline{\word{p} exc\# )} \> \uline{\word{bs} 0 THROW \textdf{is no-op}} \\
\uline{HANDLER \word{@} RP!} \> \uline{\word{p} exc\# )} \> \uline{\word{bs} \textdf{restore prev return stack}} \\
\uline{\word{Rfrom} HANDLER \word{!}} \> \uline{\word{p} exc\# )} \> \uline{\word{bs} \textdf{restore prev handler}} \\
\uline{\word{Rfrom} \word{SWAP} \word{toR}} \> \uline{\word{p} saved-sp )}\> \uline{\word{bs} exc\# \textdf{on return stack}} \\
\uline{SP! \word{DROP} \word{Rfrom}} \> \uline{\word{p} exc\# )} \> \uline{\word{bs} \textdf{restore stack}} \\
\uline{\word{bs} \textdf{Return to the caller of CATCH because return}} \\
\uline{\word{bs} \textdf{stack is restored to the state that existed}} \\
\- \uline{\word{bs} \textdf{when CATCH began execution}} \\
\- \uline{\word{THEN}} \\
\uline{\word{;}}
\+ \word{:} \word{THROW} \word{p} ??? exception\# -{}- ??? exception\# ) \\
\+ \word{qDUP} \word{IF} \> \> \word{p} exc\# ) \> \word{bs} 0 THROW \textdf{is no-op} \\
HANDLER \word{@} RP! \> \word{p} exc\# ) \> \word{bs} \textdf{restore prev return stack} \\
\word{Rfrom} HANDLER \word{!} \> \word{p} exc\# ) \> \word{bs} \textdf{restore prev handler} \\
\word{Rfrom} \word{SWAP} \word{toR} \> \word{p} saved-sp ) \> \word{bs} exc\# \textdf{on return stack} \\
SP! \word{DROP} \word{Rfrom} \> \word{p} exc\# ) \> \word{bs} \textdf{restore stack} \\
\word{bs} \textdf{Return to the caller of CATCH because return} \\
\word{bs} \textdf{stack is restored to the state that existed} \\
\- \word{bs} \textdf{when CATCH began execution} \\
\- \word{THEN} \\
\word{;}
\end{tabbing}
\cbend
\end{implement}
\begin{testing} \ttfamily
......@@ -473,7 +464,7 @@ to provide all of the Exception and Exception Extensions word sets.
\see \wref{core:ABORT}{ABORT}.
\begin{implement} % I.9.1.0875 CATCH
\place{ed12}{\word{:} \word{ABORT} ~ -1 \word{THROW} ~ \word{;}}
\word{:} \word{ABORT} ~ -1 \word{THROW} ~ \word{;}
\end{implement}
\begin{testing}
......
This diff is collapsed.
......@@ -40,6 +40,7 @@ under the following assumptions:
Append table \ref{file:types} to table \ref{table:datatypes}.
\patch{x:throw-iors}
\begin{table}[h]
\begin{center}
\caption{Data types}
......@@ -48,7 +49,9 @@ Append table \ref{file:types} to table \ref{table:datatypes}.
\hline\hline
\emph{Symbol} & \emph{Data type} & \emph{Size on stack} \\
\hline
\emph{ior} & I/O results & 1 cell \\
\cbstart
\sout{\emph{ior}} & \sout{I/O results} & \sout{1 cell} \\
\cbend
\emph{fam} & file access method & 1 cell \\
\emph{fileid} & file identifier & 1 cell \\
\hline\hline
......@@ -63,18 +66,22 @@ that are passed to file operators to designate specific files.
Opening a file assigns a file identifier, which remains valid
until closed.
\subsubsection{I/O results} % 11.3.1.2
\cbstart\patch{x:throw-iors}
\subsubsection[I/O results]{\sout{I/O results}} % 11.3.1.2
\label{file:ior}
\sout{%
I/O results are single-cell numbers indicating the result of I/O
operations. A value of zero indicates that the I/O operation
completed successfully; other values and their meanings are
implementation-defined. Reaching the end of a file shall be
reported as zero.
reported as zero.}
\sout{%
An I/O exception in the execution of a File-Access word that can
return an I/O result shall not cause a \word[exception]{THROW};
exception indications are returned in the \emph{ior}.
exception indications are returned in the \emph{ior}.}
\cbend
\subsubsection{File access methods} % 11.3.1.3
......@@ -112,10 +119,9 @@ 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. During text interpretation from a text file, the
value returned by \word{FILE-POSITION} for the \param{fileid} returned
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}.
by \word{SOURCE-ID} is undefined. A standard program
shall not call \word{REPOSITION-FILE} on the \param{fileid} returned
by \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
......@@ -172,7 +178,7 @@ See: \xref[3.4.1 Parsing]{usage:parsing}.
\item input file state after an exception
(\wref{file:INCLUDE-FILE}{INCLUDE-FILE},
\wref{file:INCLUDED}{INCLUDED});
\item \emph{ior} values and meaning (\xref[11.3.1.2 I/O results]{file:ior});
\item \remove{x:throw-iors}{\emph{ior} values and meaning} (\xref[11.3.1.2 I/O results]{file:ior});
\item maximum depth of file input nesting
(\xref[11.3.4 Input source]{file:source});
\item maximum size of input line (\xref[11.3.6 Parsing]{file:parsing});
......@@ -237,9 +243,7 @@ See: \xref[3.4.1 Parsing]{usage:parsing}.
\section{Compliance and labeling} % 11.5
\cbstart\patch{F12}
\subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 11.5.1
\cbend
\subsection{Forth-\snapshot{} systems} % 11.5.1
The phrase ``Providing the File Access word set'' shall be appended
to the label of any Standard System that provides all of the File
......@@ -253,9 +257,7 @@ 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{F12}
\subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 11.5.2
\cbend
\subsection{Forth-\snapshot{} programs} % 11.5.2
The phrase ``Requiring the File Access word set'' shall be appended
to the label of Standard Programs that require the system to provide
......@@ -314,13 +316,9 @@ 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 \remove{ed12}{Technical} Committee intends that, in
of at least 8 bits. The 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.
\remove{ed12}{The
Technical Committee has declined to address issues regarding
the impact of ``wide'' characters on the File and Block word
sets.}
\end{rationale}
\end{worddef}
......@@ -623,7 +621,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
\remove{ed12}{(unexpected)} exception conditions, which are reported as
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.
......@@ -697,12 +695,6 @@ 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 ``\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
zero-length line cannot be used to signify end-of-file.
......@@ -858,13 +850,11 @@ provide all of the File Access and File Access Extensions word sets.
When the possibility of overwriting a string can arise, it is
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.}
\end{rationale}
\begin{testing}
\test{\word{Sq} A String"\word{2DROP}}{} \tab \word{bs} \textdf{There is no space between the " and \word{2DROP}}
\end{testing}
\end{worddef}
......
......@@ -267,10 +267,10 @@ See:
(\wref{floating:Fd}{F.},
\wref{floating:FEd}{FE.},
\wref{floating:FSd}{FS.}).
\item \place{x:stoftos}{\param{n} can't be precisely represented as
\emph{float} in \wref{floating:StoF}{S>F};}
\item \place{x:stoftos}{integer part of \emph{float} can't be represented
by \param{n} in \wref{floating:FtoS}{F>S}.}
\item \param{n} can't be precisely represented as
\emph{float} in \wref{floating:StoF}{S>F};
\item integer part of \emph{float} can't be represented
by \param{n} in \wref{floating:FtoS}{F>S}.
\end{itemize}
\subsubsection{Other system documentation} % 12.4.1.3
......@@ -304,9 +304,7 @@ See:
\section{Compliance and labeling} % 12.5
\cbstart\patch{F12}
\subsection[Forth-\snapshot systems]{Forth-\snapshot\strike{-1}{25} systems} % 12.5.1
\cbend
\subsection{Forth-\snapshot{} systems} % 12.5.1
The phrase ``Providing the Floating-Point word set'' shall be
appended to the label of any Standard System that provides all of
......@@ -321,9 +319,7 @@ The phrase ``Providing the Floating-Point Extensions word set'' shall
be appended to the label of any Standard System that provides all of
the Floating-Point and Floating-Point Extensions word sets.
\cbstart\patch{F12}
\subsection[Forth-\snapshot programs]{Forth-\snapshot\strike{-1}{25} programs} % 12.5.2
\cbend
\subsection{Forth-\snapshot{} programs} % 12.5.2
The phrase ``Requiring the Floating-Point word set'' shall be
appended to the label of Standard Programs that require the system
......@@ -383,8 +379,8 @@ word sets.
does the text interpreter since the latter defines rules for
composing source programs whereas \word{toFLOAT} defines rules
for accepting data. \word{toFLOAT} is defined as broadly as is
feasible to permit input of data from Forth\place{F12}{-\snapshot} systems as well
as other widely used standard programming environments.
feasible to permit input of data from Forth-\snapshot{} systems
as well as other widely used standard programming environments.
This is a synthesis of common FORTRAN practice. Embedded spaces
are explicitly forbidden in much scientific usage, as are other
......@@ -484,8 +480,11 @@ word sets.
\param{d} is the double-cell signed-integer equivalent of the
integer portion of \param{r}. The fractional portion of \param{r}
is discarded. An ambiguous condition exists if the integer portion
of \param{r} cannot be precisely represented as a double-cell
of \param{r} cannot be \remove{ed13}{precisely} represented as a double-cell
signed integer.
\note \place{ed13}{Rounding the floating-point value prior to calling \word{FtoD} is
advised, because \word{FtoD} rounds towards zero.}
\end{worddef}
......@@ -825,14 +824,10 @@ word sets.
given below.
\execute[name]
\cbstart\patch{ed12}
\stack{\sout{a-}addr_{\uline{1}}}{\sout{df-}addr_{\uline{2}}}
\cbend
\stack{addr_1}{addr_2}
Add the \param{offset} calculated during the compile time action to
\cbstart\param{\sout{a-}addr_{\uline{1}}}\cbend\
giving the double-float aligned address
\cbstart\param{\sout{df-}addr_{\uline{2}}}.\cbend
\param{addr_1} giving the \remove{ed13}{double-float aligned} address \param{addr_2}.
\see \wref{facility:+FIELD}{+FIELD},
\wref{facility:BEGIN-STRUCTURE}{BEGIN-STRUCTURE}, \\
......@@ -883,36 +878,36 @@ word sets.
exceeds the size of the pictured numeric output string buffer.
\see \wref{floating:toFLOAT}{>FLOAT},
\rref{floating:Fd}{}.
\rref{floating:Fd}{}
\begin{rationale} % A.12.6.1.1427 F.
For example, \texttt{1E3} \replace{ed12}{\textbf{\texttt{F}}}{ \word{Fd}} displays \texttt{1000.} .
For example, \texttt{1E3} \word{Fd} displays \texttt{1000.}
\end{rationale}
\end{worddef}
% ========== x:stoftos ==========
\begin{worddef*}[FtoS]{1471}{F>S}[F to S][x:stoftos]
\begin{worddef}[FtoS]{1471}{F>S}[F to S][x:stoftos]
\item \stack{}{n} \stack[F]{r}{} or \stack{r}{n}
\uline{\param{n} is the single-cell signed-integer equivalent of the
\param{n} is the single-cell signed-integer equivalent of the
integer portion of \param{r}. The fractional portion of
\param{r} is discarded. An ambiguous condition exists if
the integer portion of \param{r} cannot be precisely
represented as a single-cell signed integer.}
the integer portion of \param{r} cannot be \remove{ed13}{precisely}
represented as a single-cell signed integer.
\note \uline{Rounding the floating-point value prior to calling \word{FtoS} is
advised.}
\note Rounding the floating-point value prior to calling \word{FtoS} is
advised\place{ed13}{, because \word{FtoS} rounds towards zero}.
\see \uline{\wref{floating:StoF}{}.}
\see \wref{floating:StoF}{}.
\begin{implement}
\uline{\word{:} \word{FtoS} \word{p} r -{}- n )} \\
\tab \uline{\word{FtoD} \word[double]{DtoS}} \\
\uline{\word{;}}
\word{:} \word{FtoS} \word{p} r -{}- n ) \\
\tab \word{FtoD} \word[double]{DtoS} \\
\word{;}
\end{implement}
\end{worddef*}
\end{worddef}
% ==============================
......@@ -1014,11 +1009,6 @@ word sets.
equivalent to \word{FTAN}, but is useful over only a limited
and discontinuous range of angles, whereas \word{FSINCOS} and
\word{FATAN2} are useful for all angles.
\remove{ed12}{This ordering has
been found convenient for nearly two decades, and has the
added benefit of being easy to remember. A corollary to this
observation is that vectors in general should appear on the
stack in this order.}
The argument order for \word{FATAN2} is the same, converting a
vector in the conventional representation to a scalar angle.
......@@ -1243,14 +1233,14 @@ word sets.
This function allows accurate computation when its arguments
are close to zero, and provides a useful base for the standard
exponential functions. Hyperbolic functions such as
\textsf{\replace{ed12}{cosh}{sinh}($x$)} can be efficiently and accurately
\textsf{sinh($x$)} can be efficiently and accurately
implemented by using \word{FEXPM1}; accuracy is lost in this
function for small values of $x$ if the word \word{FEXP} is
used.
An important application of this word is in finance; say a loan
is repaid at 15\% per year; what is the daily rate? On a computer
with single\place{ed12}{-}precision (six decimal digit) accuracy:
with single-precision (six decimal digit) accuracy:
\begin{enumerate}
\item[1.] Using \word{FLN} and \word{FEXP}:
......@@ -1260,7 +1250,7 @@ word sets.
form the exponent using \word{FEXP} = 1.00038, and \\
subtract one (1) and convert to percentage = 0.038\%.
\end{enumerate}
Thus we only have two\place{ed12}{-}digit accuracy.
Thus we only have two-digit accuracy.
\begin{enumerate}
\item[2.] Using \word{FLNP1} and \word{FEXPM1}:
......@@ -1272,11 +1262,11 @@ word sets.
\word{FEXPM1} = 3.82983E-4, and \\
convert to percentage = 0.0382983\%.
\end{enumerate}
This is full six\place{ed12}{-}digit accuracy.
\replace{ed12}{The presence of this}{ This} \remove{ed12}{word} allows the hyperbolic functions to
be computed with usable accuracy. For example, the hyperbolic
sine can be defined as:
This \replace{ed13}{is full six-digit accuracy.}{ calculation method allows}
\remove{ed13}{This allows}
the hyperbolic functions to
be computed with \replace{ed13}{usable accuracy}{ six-digit accuracy}. For example, \replace{ed13}{the hyperbolic
sine}{ \textsf{sinh}} can be defined as:
\begin{quote}\ttfamily
\word[core]{:} \word{FSINH}~ \word[core]{p} r1 -{}- r2 ) \\
......@@ -1301,14 +1291,10 @@ word sets.
given below.
\execute[name]
\cbstart\patch{ed12}
\stack{\sout{a-}addr_{\uline{1}}}{\sout{f-}addr_{\uline{2}}}
\cbend
\stack{addr_1}{addr_2}
Add the \param{offset} calculated during the compile time action to
\cbstart\param{\sout{a-}addr_{\uline{1}}}\cbend\
giving the float aligned address
\cbstart\param{\sout{f-}addr_{\uline{2}}}.\cbend
\param{addr_1} giving the \remove{ed13}{float aligned} address \param{addr_2}.
\see \wref{facility:+FIELD}{+FIELD},
\wref{facility:BEGIN-STRUCTURE}{BEGIN-STRUCTURE}, \\
......@@ -1578,21 +1564,21 @@ word sets.
% ========== x:stoftos ==========
\begin{worddef*}[StoF]{2175}{S>F}[S to F][x:stoftos]
\begin{worddef}[StoF]{2175}{S>F}[S to F][x:stoftos]
\item \stack{n}{} \stack[F]{}{r} or \stack{n}{r}
\uline{\param{r} is the floating-point equivalent of the single-cell
\param{r} is the floating-point equivalent of the single-cell
value \param{n}. An ambiguous condition exists if \param{n}
can not be precisely represented as a floating-point value.}
can not be precisely represented as a floating-point value.
\see \uline{\wref{floating:FtoS}{F>S}.}
\see \wref{floating:FtoS}{F>S}.
\begin{implement}
\uline{\word{:} \word{StoF} \word{p} n -{}- r )} \\
\tab \uline{\word{StoD} \word{DtoF}} \\
\uline{\word{;}}
\word{:} \word{StoF} \word{p} n -{}- r ) \\
\tab \word{StoD} \word{DtoF} \\
\word{;}
\end{implement}
\end{worddef*}
\end{worddef}
% ==============================
......@@ -1673,14 +1659,10 @@ word sets.
given below.
\execute[name]
\cbstart\patch{ed12}
\stack{\sout{a-}addr_{\uline{1}}}{\sout{sf-}addr_{\uline{2}}}
\cbend
\stack{addr_1}{addr_2}
Add the \param{offset} calculated during the compile time action to
\cbstart\param{\sout{a-}addr_{\uline{1}}}\cbend\
giving the single-float aligned address
\cbstart\param{\sout{sf-}addr_{\uline{2}}}.\cbend
\param{addr_1} giving the \remove{ed13}{single-float aligned} address \param{addr_2}.
\see \wref{facility:+FIELD}{+FIELD},
\wref{facility:BEGIN-STRUCTURE}{BEGIN-STRUCTURE}, \\
......
\chapter*{Foreword to ANS Forth}
\addcontentsline{toc}{section}{Foreword to ANS Forth}
\markboth{Foreword}{Foreword to ANS Forth}
% !TeX root = forth.tex
% !TeX spell = en_US
\cbstart\patch{x:foreward}
\vspace*{-6ex}\chapter*{Foreword\sout{ to ANS Forth}}