Commit fd589204 authored by pknaggs's avatar pknaggs
Browse files

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{}{}
......
......@@ -30,10 +30,9 @@
% =========================================================
\version{05}{Original Text.}{\empty}
Original document based on the \replace{ed12}{dpANS99a}{dpANS6}
basis document distributed as \replace{ed12}{part of the review
undertaken by the X3/X3J14 TC in 1999}{the final public draft
during the development of Forth 94 (ANS X3.215-1994).}
Original document based on the dpANS6 basis document distributed
as the final public draft during the development of Forth 94
(ANS X3.215-1994).
\version{06.1}{Santander Meeting}{21--23 October, 2005}
\begin{enumerate}
......@@ -92,7 +91,7 @@
\version{06.2}{Minor additions}{30 August 2006}
\begin{enumerate}
\item Added validation and reference implementations for new words:
\item[6] Added validation and reference implementations for new words:
\wref{core:ACTION-OF}{ACTION-OF},
\wref{core:DEFER}{DEFER},
\wref{core:DEFER!}{DEFER!},
......@@ -102,7 +101,7 @@
\wref{tools:[DEFINED]}{[DEFINED]} and
\wref{tools:[UNDEFINED]}{[UNDEFINED]}.
\item Annex G was sorted numerically, this was changed to a full
\item[G] Annex G was sorted numerically, this was changed to a full
Alphabetical sort.
\end{enumerate}
......@@ -269,7 +268,7 @@
\begin{enumerate}
\item Corrected a number of section numbering errors
\item \textsf{X:number-prefix}:
Added test cases (\xref{rat:notation:numeric}).
Added test cases (A.3.4.1.3 Numeric notation).
\end{enumerate}
\item[B] Bibliography (Annex \ref{annex:bib}):
......@@ -286,7 +285,7 @@
% =========================================================
\version{08.1}{Vienna Meeting}{25--26 Septenber, 2008}
\version{08.1}{Vienna Meeting}{25--26 September, 2008}
\begin{itemize}
\item \xref{process}: \\
\textsf{ed08}: Changed ``an standard'' to ``a standard''.
......@@ -792,7 +791,7 @@
\item[A] Rationale (Annex \ref{annex:rationale}):
\begin{enumerate}
\item \textsf{F94}: Removed reference to ``X3J14'' (three times)
\item \textsf{ed11}: Moved test cased from \xref{rat:notation:numeric} to \xref{test:numeric}.
\item \textsf{ed11}: Moved test cases from A.3.4.1.3 Numeric notation to \xref{test:numeric}.
\item \textsf{x:buffer}: Added \rref{core:BUFFER:}{}.
\item \textsf{x:block}: Added \xref{rat:block:buffers}.
\item \textsf{ed11}: Revised \rref{facility:FIELD:}{}.
......@@ -806,7 +805,7 @@
\begin{enumerate}
\item \textsf{F94}: Revised \xref{diff:ans} to the past tense.
\item \textsf{F94}: Added \xref{diff:iso}.
\item \textsf{ed11}: Added \xref{diff:94:obsolete}.
\item \textsf{ed11}: Added \textbf{C.7.2 Obsolescent features}.
\end{enumerate}
\item[F] Reference Implementations (Annex \ref{annex:implement}):
......@@ -930,11 +929,14 @@
\item[A] Rationale (Annex \ref{annex:rationale}): % rationale
\begin{enumerate}
\item \textsf{ed12}: Revised \xref{rat:scope}, \xref{rat:aaddr}.
\item \textsf{ed12}: Removed \xref{rat:wordsets}.
\item \textsf{ed12}: Removed \textbf{A.1.3.1 Word sets}.
\item \textsf{ed12}: Renumbered \xref{rat:obsolete}.
% Core
\item \textsf{ed12}: Removed \rref{core:2*}{}, \rref{core:2/}{}, \rref{core:2@}{},
\rref{core:EVALUATE}{}.
\item \textsf{ed12}: Removed
\textbf{A.6.1.0320 2*},
\textbf{A.6.1.0330 2/},
\textbf{A.6.1.0350 2@},
\textbf{A.6.1.1360 EVALUATE}.
\item \textsf{ed12}: Removed first and third paragraphs from \rref{core:ACCEPT}{}.
\item \textsf{ed12}: Removed first paragraph of \rref{core:2toR}{}.
\item \textsf{ed12}: Removed last paragraph of \rref{core:ENVIRONMENTq}{},
......@@ -952,7 +954,7 @@
\xref{rat:exception} to \linebreak \iref{core:QUIT}{}, \iref{exception:CATCH}{},
\iref{exception:THROW}{} and \iref{exception:ABORT}{}.
% Facility
\item \textsf{ed12}: Removed rational for \rref{facility:AT-XY}.
\item \textsf{ed12}: Removed rational for \textbf{A.10.6.0742 AT-XY}.
\item \textsf{ed12}: Removed alignment requirements in rational for
\rref{facility:FIELD:}{}.
% File
......@@ -968,8 +970,8 @@
\item \textsf{ed12}: Removed comment on stack ordering from \rref{floating:FATAN2}.
\item \textsf{ed12}: Replaced example hyperbolic function in \rref{floating:FEXPM1}.
% Locals
\item \textsf{ed12}: Removed introduction to \xref{rat:local}.
\item \textsf{ed12}: Removed \rref{local:LOCALS}{}.
\item \textsf{ed12}: Removed introduction to \xref{locals:intro}.
\item \textsf{ed12}: Removed \textbf{A.13.6.2.1795 LOCALS|}.
\item \textsf{ed12}: ``where'' to ``were'' in \rref{local:b:}{}.
% Memory
% Tools
......@@ -979,7 +981,7 @@
% Search
\item \textsf{ed12}: Revised introduction to \xref{rat:search}.
\item \textsf{ed12}: Revised \rref{search:SEARCH-WORDLIST}{}.
\item \textsf{ed12}: Moved implementation from \rref{search:ALSO}{} to
\item \textsf{ed12}: Moved implementation from \textbf{A.16.6.2.0715 ALSO} to
\iref{search:DEFINITIONS}{},
\iref{search:FIND}{},
\iref{search:GET-ORDER}{},
......@@ -992,7 +994,7 @@
% String
\item \textsf{ed12}: Revised \rref{string:/STRING}{}, \rref{string:CMOVE}{},
\rref{string:CMOVEtop}{}, \rref{string:SUBSTITUTE}{}.
\item \textsf{ed12}: Removed \rref{string:COMPARE}{}, \rref{string:SEARCH}{}.
\item \textsf{ed12}: Removed \textbf{A.17.6.1.0935 COMPARE}, \textbf{A.17.6.1.2191 SEARCH}.
% Xchar
\end{enumerate}
......@@ -1047,6 +1049,176 @@
% Xchar
\end{itemize}
\version{12.2}{Testing updates}{\empty}
\begin{itemize}
\item[F] Test Suite (Annex \ref{annex:test}): \\
\textsf{test12}: Test suite updated in line with Gerry Jackson's test suite (version 0.9):
\begin{enumerate}
\item Added support word for \xref{test:memory}{}.
\item Added tests to
\tref{core:p}{(},
\tref{core:.q}{.\"{}},
\tref{core:IMMEDIATE}{IMMEDIATE},
\tref{file:Sq}{S\"{}},
\tref{memory:FREE}{FREE}.
\item Additional test for
\tref{core:+LOOP}{+LOOP},
\tref{core:toIN}{$>$IN},
\tref{core:IF}{IF},
\tref{core:Sq}{S\"{}},
\tref{double:2CONSTANT}{2CONSTANT},
\tref{double:2LITERAL}{2LITERAL},
\tref{double:2VARIABLE}{2VARIABLE},
\tref{memory:ALLOCATE}{ALLOCATE},
\tref{tools:[THEN]}{[THEN]}.
\item Modified tests for
\tref{memory:RESIZE}{RESIZE}.
\end{enumerate}
\end{itemize}
\version{13.1}{Hamburg Meeting}{25--27 September 2013}
\begin{itemize}
\item \xref{foreword}: % foreword
~\\ \textsf{ed13}: Merged \textbf{Foreword to ANS Forth} with \textbf{Foreword}.
\item \xref{members}: % members-2x
\begin{enumerate}
\item \textsf{ed13}: Removed Bill Stoddart.
\item \textsf{ed13}: Added Willi Stricker and Simon Kaphahn.
\item \textsf{ed13}: Added ``previous members'' and ``contributors''.
\end{enumerate}
\item[1] Introduction: % intro
~ \\
\textsf{ed13}: Revised description of Annex \ref{annex:index}.
\item[3] Usage requirements: % usage
\begin{enumerate}
\item \textsf{x:throw-iors}:
Added \param{ior} to \xref{usage:type}, table \xref{table:datatypes}
and \xref{usage:ior}.
\item \textsf{x:traverse-wordlist}:
Added \textsf{x:traverse-wordlist} to \xref{table:extensions}.
\end{enumerate}
\item[9] Exception Word Set: % exception
~ \\
\textsf{x:throw-iors}: Remove paragraph 2 of \xref{exception:throw}.
\item[10] Facility Word Set: % facility
~ \\
\textsf{ed13}: Removed alignment requirement from \wref{facility:CFIELD:}{}, \wref{facility:FIELD:}{}.
\item[11] File-Access Word Set: % file
\begin{enumerate}
\item \textsf{x:throw-iors}: Removed \param{ior} from table \xref{file:types}.
\item \textsf{x:throw-iors}: Removed \xref{file:ior}.
\item \textsf{x:thorw-iors}: Removed \param{ior} documentation requirement from \xref{file:impopt}.
\end{enumerate}
\item[12] Floating-Point Word Set: % float
\begin{enumerate}
\item \textsf{ed13}: Added advisory note to \wref{floating:FtoD}{}.
\item \textsf{ed13}: Revised advisory note for \wref{floating:FtoS}{}.
\item \textsf{x:throw-iors}: Removed alignment requirements from
\wref{floating:DFFIELD:}{},
\wref{floating:FFIELD:}{},
\wref{floating:SFFIELD:}{}.
\end{enumerate}
\item[14] Memory-Allocation Word Set: % memory
\begin{enumerate}
\item \textsf{x:throw-iors}: Removed \xref{mem:ior}{}.
\item \textsf{x:throw-iors}: Replaced \xref{mem:docs}{}.
\end{enumerate}
\item[15] Programming-Tools Word Set: % tools
\begin{enumerate}
\item \textsf{x:traverse-wordlist}: Added \xref{tools:datatype}{}.
\item \textsf{x:traverse-wordlist}: Added ambiguous condition to \xref{tools:ambiguous}{}.
\item \textsf{x:traverse-wordlist}: Added
\wref{tools:NAMEtoCOMPILE}{},
\wref{tools:NAMEtoINTERPRET}{},
\wref{tools:NAMEtoSTRING}{},
\wref{tools:TRAVERSE-WORDLIST}{}.
\end{enumerate}
\item[17] String Word Set: % string
~ \\
\textsf{ed13}: Minor revisions to \wref{string:SUBSTITUTE}{}.
\item[18] Extended Character Word Set % xchar
\begin{enumerate}
\item \textsf{x:ed13}: Added \xref{xchar:io}{}.
\item \textsf{x:ed13}: Removed first sentence of \xref{xchar:impopt}{}.
\end{enumerate}
\item[A] Rationale (Annex \ref{annex:rationale}): % rationale
\begin{enumerate}
\item \textsf{ed13}: Revised first line of \xref{rat:scope}{}.
\item \textsf{ed13}: Removed \xref{doc:org}{}.
\item \textsf{x:throw-iors}: Added \xref{rat:ior}{}.
\item \textsf{ed13}: Minor revision to second paragraph of \xref{rat:aaddr}{}.
\item \textsf{ed13}: Corrected typo in \xref{rat:regions}{}.
% Core
\item \textsf{ed13}: ``Since'' replaced by ``Because'' in \rref{core:ACCEPT}{}.
\item \textsf{ed13}: Added ``LOOP'' to typical use of \rref{core:LEAVE}{}.
\item \textsf{ed13}: Placed typical use inside a colon definition (\rref{core:qDO}{}).
\item \textsf{ed13}: Revised \rref{core:COMPILE,}{}.
\item \textsf{ed13}: Minor revision of \rref{core:PARSE}{}.
\item \textsf{ed13}: Minor revision of \rref{core:TO}{}.
% Block
\item \textsf{ed13}: Removed second paragraph of \xref{rat:block}{}.
\item \textsf{ed13}: Removed reference to \textbf{C.7.9 Multitasking} from \xref{rat:block:buffers}{}.
% \item \textsf{ed13}: Remove ``(store)'' from second
% Facility
\item \textsf{ed13}: Revised \rref{facility:EKEYtoFKEY}{}.
% Float
\item \textsf{ed13}: Minor revision to \rref{floating:FEXPM1}{}.
% Locals
\item \textsf{ed13}: Minor revision to \ref{local:b:}{}.
% Tools
\item \textsf{x:traverse-wordlist}:
Added \xref{rat:tools:nt}{},
\rref{tools:NAMEtoCOMPILE}{},
\rref{tools:TRAVERSE-WORDLIST}{}.
% String
\item \textsf{ed13}: Minor revision to \rref{string:SUBSTITUTE}{}.
\end{enumerate}
\item[C] Compatibility analysis (Annex \ref{annex:diff}): % diff
\begin{enumerate}
\item \textsf{ed13}: Moved paragraph in \xref{diff:ans}{}.
\item \textsf{ed13}: Minor revision to \xref{diff:approach}{}.
\item \textsf{x:obsolete}: Replaced \xref{diff:ans:obsolete}{}.
\item Replaced \xref{diff:94:obsolete} with \xref{diff:fpstack}{} (\textsf{x:fpstack})
and \xref{diff:environment}{} (\textsf{x:environment}).
\item Added
\xref{diff:12:to}{} (\textsf{x:to}),
\xref{diff:12:ior}{} (\textsf{x:thorw-iors}),
\xref{diff:12:locals}{} (\textsf{x:locals}),
\xref{diff:12:prefix}{}, (\textsf{x:number-prefix}),
\xref{diff:12:sourceid}{}, (\textsf{x:source-id}),
\xref{diff:12:fasinh}{} (\textsf{x:fasinh}),
\xref{diff:12:fatan2}{} (\textsf{x:fatan2}).
\item \textsf{x:traverse-wordlist}: Added \word[tools]{NAMEtoCOMPILE},
\word[tools]{NAMEtoINTERPRET}, \word[tools]{NAMEtoSTRING}, \linebreak
\word[tools]{TRAVERSE-WORDLIST} to \xref{diff:12:tools}{}.
\end{enumerate}
\item[D] Portability guide (Annex \ref{annex:port}): % port
\begin{enumerate}
\item \textsf{ed13}: Minor revisions to \xref{port:intro}{}.
\item \textsf{ed13}: ``big endian'' to ``big-endian'' in \xref{port:endian}{}.
\end{enumerate}
\end{itemize}
\endinput
......
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