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{}{}
......
......@@ -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
......
% !TeX root = forth.tex
% !TeX spellcheck = en_US
\chapter{Glossary} % 6
\section{Core words} % 6.1
......@@ -128,14 +130,13 @@
\xref[3.4.1 Parsing]{usage:parsing},
\rref{core:'}{},
\rref{core:POSTPONE}{POSTPONE},
\rref{core:[']}{[']},
\xref[D.6.7 Immediacy]{diff:immediate}.
\rref{core:[']}{[']}.
\begin{rationale} % A.6.1.0070 '
Typical use: {\ldots} \word{'} \param{name}.
Many Forth systems use a state-smart tick. Many do not.
\replace{ed12}{We follow}{Forth-\snapshot\ follows} the usage of Forth 94.
Forth-\snapshot\ follows the usage of Forth 94.
\see \xref[A.3.4.3..2 Interpretation semantics]{rat:interpret},
\rref{core:FIND}{FIND}.
......@@ -169,6 +170,12 @@
\begin{rationale} % A.6.1.0080 (
Typical use: {\ldots} \word{p} \param{ccc}\texttt{)} {\ldots}
\end{rationale}
\begin{testing}
\word{bs} \textdf{There is no space either side of the ).}\\[\parskip]
\test{\word{p} A comment)1234}{} \\
\test{\word{:} pc1 \word{p} A comment)1234 \word{;} pc1}{1234}
\end{testing}
\end{worddef}
......@@ -399,6 +406,23 @@
\test{ -20 30 -10 gd7}{30 20 10 0 -10 -20 6 } \\
\test{ -20 31 -10 gd7}{31 21 11 1 -9 -19 6 } \\
\test{ -20 29 -10 gd7}{29 19 9 -1 -11 5 }
\word{bs} \textdf{With large and small increments}
MAX-UINT 8 RSHIFT 1+ CONSTANT ustep \\
ustep NEGATE CONSTANT -ustep \\
MAX-INT 7 RSHIFT 1+ CONSTANT step \\
step NEGATE CONSTANT -step
\word{VARIABLE} bump
\test{ \word{:} gd8 bump \word{!} \word{DO} \word{1+} bump \word{@} \word{+LOOP} \word{;}}{}
\test{ 0 MAX-UINT 0 ustep gd8}{256} \\
\test{ 0 0 MAX-UINT -ustep gd8}{256} \\
\test{ 0 MAX-INT MIN-INT step gd8}{256} \\
\test{ 0 MIN-INT MAX-INT -step gd8}{256}
\end{testing}
\end{worddef}
......@@ -522,6 +546,8 @@
\end{rationale}
\begin{testing} % T.6.1.0190 ."
\test{\word{:} pb1 \word{CR} \word{.q} You should see 2345: "\word{.q} 2345"\word{;} pb1}{}
See \tref{core:EMIT}{EMIT}.
\end{testing}
\end{worddef}
......@@ -700,19 +726,6 @@
the most-significant bit, filling the vacated least-significant
bit with zero.
\see \remove{ed12}{\rref{core:2*}{}.}
\begin{rationale} % A.6.1.0320 2*
\remove{ed12}{%
Historically, \word{2*} has been implemented on
two's-complement machines as a logical left-shift instruction.
Multiplication by two is an efficient side-effect on these
machines. However, shifting implies a knowledge of the
significance and position of bits in a cell. While the name
implies multiplication, most implementors have used a hardware
left shift to implement \word{2*}.}
\end{rationale}
\begin{testing} % T.6.1.0320 2*
\test{ 0S \word{2*} }{ 0S} \\
\test{ 1 \word{2*} }{ 2} \\
......@@ -730,16 +743,6 @@
the least-significant bit, leaving the most-significant bit
unchanged.
\see \remove{ed12}{\rref{core:2/}{}.}
\begin{rationale} % A.6.1.0330 2/
\remove{ed12}{%
This word has the same common usage and misnaming implications
as \word{2*}. It is often implemented on two's-complement
machines with a hardware right shift that propagates the sign
bit.}
\end{rationale}
\begin{testing} % T.6.1.0330 2/
\test{ 0S \word{2/}}{ 0S} \\
\test{ 1 \word{2/}}{ 0} \\
......@@ -760,14 +763,7 @@
\word{DUP} \word{CELL+} \word{@} \word{SWAP} \word{@}.
\see \xref[3.3.3.1 Address alignment]{usage:aaddr},
\wref{core:2!}{2!}%,
\remove{ed12}{, \rref{core:2@}{}}.
\begin{rationale} % A.6.1.0350 2@
\remove{ed12}{%
With \word{2@} the storage order is specified by the Standard.
}
\end{rationale}
\wref{core:2!}{2!}.
\begin{testing} % T.6.1.0350 2@
See \tref{core:,}{,}.
......@@ -861,7 +857,7 @@
\word{:} \emph{name} {\ldots} \word{;}
In Forth 83, this word was specified to alter the search order.
This specification is explicitly removed in this Standard. We
This specification is explicitly removed in this standard. We
believe that in most cases this has no effect; however, systems
that allow many search orders found the Forth-83 behavior of
colon very undesirable.
......@@ -1063,6 +1059,13 @@
\word{:} GS2 5 SCANS \word{!} \word{Sq} 123 RESCAN?" \word{EVALUATE} \word{;} \\
\test{GS2}{123 123 123 123 123}
\word{bs} \textdf{These tests must start on a new line} \\
\word{DECIMAL} \\
T\{ 123456 \word{DEPTH} \word{OVER} 9 \word{less} 35 \word{AND} \word{+} 3 \word{+} \word{toIN} \word{!} \\
-> 123456 23456 3456 456 56 6 \}T \\
T\{ 14145 8115 \word{qDUP} \word{0=} 34 \word{AND} \word{toIN} \word{+!} \word{TUCK} \word{MOD} 14 \word{toIN} \word{!} GCD calculation \\
-> 15 \}T
\end{testing}
\end{worddef}
......@@ -1260,46 +1263,19 @@
\see \rref{core:ACCEPT}{}.
\begin{rationale} % A.6.1.0695 ACCEPT
\remove{ed12}{%
Previous standards specified that collection of the input
string terminates when either a ``return'' is received or when}
\param{+n_1} \sout{characters have been received. Terminating when}
\param{+n_1} \remove{ed12}{characters have been received is difficult,
expensive, or impossible to implement in some system environments.
Consequently, a number of existing implementations do not
comply with this requirement. Since line-editing and collection
functions are often implemented by system components beyond the
control of the Forth implementation, this Standard imposes no
such requirement. A Standard Program may only assume that it
can receive an input string with \word{ACCEPT}
The detailed sequence of user actions necessary to prepare and
transmit that line are beyond the scope of this Standard.}
Specification of a non-zero, positive integer count (\param{+n_1})
for \word{ACCEPT} allows some implementors to continue their
practice of using a zero or negative value as a flag to trigger
special behavior. Insofar as such behavior is outside the
Standard, Standard Programs cannot depend upon it, but the
\remove{ed12}{Technical} Committee doesn't wish to preclude it unnecessarily.
Since actual values are almost always small integers, no
standard, Standard Programs cannot depend upon it, but the
committee doesn't wish to preclude it unnecessarily.
\replace{ed13}{Since}{ Because} actual values are almost always small integers, no
functionality is impaired by this restriction.
It is recommended that all non-graphic characters be reserved
for editing or control functions and not be stored in the input
string.
\remove{ed12}{%
Commonly, when the user is preparing an input string to be
transmitted to a program, the system allows the user to edit
that string and correct mistakes before transmitting the final
version of the string. The editing function is supplied
sometimes by the Forth system itself, and sometimes by external
system software or hardware. Thus, control characters and
functions may not be available on all systems. In the usual
case, the end of the editing process and final transmission of
the string is signified by the user pressing a ``Return'' or
``Enter'' key.}
Because external system hardware and software may perform the
\word{ACCEPT} function, when a line terminator is received the
action of the cursor, and therefore the display, is
......@@ -1335,7 +1311,7 @@
\rref{core:ALIGN}{}.
\begin{rationale} % A.6.1.0705 ALIGN
In this Standard we have attempted to provide transportability
In this standard we have attempted to provide transportability
across various CPU architectures. One of the frequent causes
of transportability problems is the requirement of cell-aligned
addresses on some CPUs. On these systems, \word{ALIGN} and
......@@ -2087,17 +2063,6 @@
is in an optional word set) and also a means to test the
returned flag in interpretation state (e.g. the optional
\wref{tools:[IF]}{[IF]}).
\remove{ed12}{%
The combination of
\wref{core:ENVIRONMENTq}{ENVIRONMENT?},
\wref{file:Sq}{S"},
\wref{tools:[IF]}{[IF]},
\wref{tools:[ELSE]}{[ELSE]} and
\wref{tools:[THEN]}{[THEN]}
constitutes an effective suite of words for conditional
compilation that works in interpretation state.
}
\end{rationale}
\begin{testing} % T.6.1.1345 ENVIRONMENT?
......@@ -2119,21 +2084,6 @@
specification. Other stack effects are due to the words
\word{EVALUATE}d.
\see \remove{ed12}{\rref{core:EVALUATE}{}.}
\begin{rationale} % A.6.1.1360 EVALUATE
\remove{ed12}{%
The Technical Committee is aware that this function is
commonly spelled \texttt{EVAL}. However, there exist
implementations that could suffer by defining the word as is
done here. We also find \word{EVALUATE} to be more readable
and explicit. There was some sentiment for calling this
\texttt{INTERPRET}, but that too would have undesirable
effects on existing code. The longer spelling was not deemed
significant since this is not a word that should be used
frequently in source code.}
\end{rationale}
\begin{testing} % T.6.1.1360 EVALUATE
\ttfamily
\word{:} GE1 \word{Sq} 123" \word{;} \word{IMMEDIATE} \\
......@@ -2238,11 +2188,10 @@
\rref{core:'}{'},
\rref{core:FIND}{}, \\
\rref{core:POSTPONE}{POSTPONE},
\rref{core:[']}{[']},
\xref[D.6.7 Immediacy]{diff:immediate}.
\rref{core:[']}{[']}.
\begin{rationale} % A.6.1.1550 FIND
One of the more difficult issues which the Committee took on
One of the more difficult issues which the committee took on
was the problem of divorcing the specification of
implementation mechanisms from the specification of the
Forth language. Three basic implementation approaches can be
......@@ -2279,7 +2228,7 @@
One type 3 implementation, Charles Moore's cmForth, has both
compiling and interpreting versions of many Forth words. At the
present, this appears to be a common approach for type 3
implementations. The Committee felt that this implementation
implementations. The committee felt that this implementation
approach must be allowed. Consequently, it is possible that
words without interpretation semantics can be found only during
compilation, and other words may exist in two versions: a
......@@ -2331,14 +2280,14 @@
languages of implementing division according to the behavior
of the host CPU, which is most often symmetric (rounded toward
zero). In attempting to find a compromise position, this
Standard provides primitives for both common varieties, floored
standard provides primitives for both common varieties, floored
and symmetric (see \word{SM/REM}). \word{FM/MOD} is the floored
version.
The \remove{ed12}{Technical} Committee considered providing two complete sets
The committee considered providing two complete sets
of explicitly named division operators, and declined to do so
on the grounds that this would unduly enlarge and complicate
the Standard. Instead, implementors may define the normal
the standard. Instead, implementors may define the normal
division words in terms of either \word{FM/MOD} or
\word{SM/REM} providing they document their choice. People
wishing to have explicitly named sets of operators are
......@@ -2508,6 +2457,11 @@
\test{ 0 GI2}{234} \\
\test{ 1 GI2}{123} \\
\test{-1 GI1}{123}
\word{bs} \textdf{Multiple \word{ELSE}s in an \word{IF} statement} \\
\word{:} melse \word{IF} 1 \word{ELSE} 2 \word{ELSE} 3 \word{ELSE} 4 \word{ELSE} 5 \word{THEN} \word{;} \\
\test{<FALSE> melse}{2 4} \\
\test{<TRUE> melse}{1 3 5}
\end{testing}
\end{worddef}
......@@ -2520,8 +2474,7 @@
name or if it was defined as a \word[tools]{SYNONYM}.
\see \wref{tools:SYNONYM},
\rref{core:IMMEDIATE}{},
\xref[D.6.7 Immediacy]{diff:immediate}.
\rref{core:IMMEDIATE}{}.
\begin{rationale} % A.6.1.1710 IMMEDIATE
Typical use:
......@@ -2530,6 +2483,25 @@
\end{rationale}
\begin{testing} % T.6.1.1710 IMMEDIATE
\test{123 \word{CONSTANT} iw1 \word{IMMEDIATE} iw1}{123} \\
\test{\word{:} iw2 iw1 \word{LITERAL} \word{;} iw2}{123}
\test{\word{VARIABLE} iw3 \word{IMMEDIATE} 234 iw3 \word{!} iw3 \word{@}}{234} \\
\test{\word{:} iw4 iw3 \word{[} \word{@} \word{]} \word{LITERAL} \word{;} iw4}{234}
\test{\word{:NONAME} \word{[} 345 \word{]} iw3 \word{[} \word{!} \word{]} \word{;} \word{DROP} iw3 \word{@}}{345} \\
\test{\word{CREATE} iw5 456 \word{,} \word{IMMEDIATE}}{} \\
\test{\word{:NONAME} iw5 \word{[} \word{@} iw3 \word{!} \word{]} \word{;} \word{DROP} iw3 \word{@}}{456}
\test{\word{:} iw6 \word{CREATE} \word{,} \word{IMMEDIATE} \word{DOES} \word{@} \word{1+} \word{;}}{} \\
\test{111 iw6 iw7 iw7}{112} \\
\test{\word{:} iw8 iw7 \word{LITERAL} \word{1+} \word{;} iw8}{113}
\test{\word{:} iw9 \word{CREATE} \word{,} \word{DOES} \word{@} 2 \word{+} \word{IMMEDIATE} \word{;}}{} \\
\word{:} find-iw \word{BL} \word{WORD} \word{FIND} \word{NIP} \word{;} \\
\test{222 iw9 iw10 find-iw iw10}{-1} \tab \word{bs} \textdf{iw10 is not immediate} \\
\test{iw10 find-iw iw10}{224 1} \tab[3.8] \word{bs} \textdf{iw10 becomes immediate}
See \tref{core:[']}{[']},
\tref{core:POSTPONE}{POSTPONE},
\tref{core:STATE}{STATE},
......@@ -2704,7 +2676,7 @@
\tab \word{:} \texttt{X} {\ldots} \word{DO}
{\ldots} \word{IF}
{\ldots} \word{LEAVE}
\word{THEN}
\word{THEN} \place{ed13}{{\ldots} \word{LOOP} {\ldots}}
\word{;}
\end{rationale}
......@@ -2976,7 +2948,7 @@
that implies propagation if the move is suitably invoked. In
some hardware, this specific behavior cannot be achieved using
the best move instruction. Further, \word[string]{CMOVE} and
\word[string]{CMOVEtop} move characters; Forth \replace{ed12}{needed}{ needs} a move
\word[string]{CMOVEtop} move characters; Forth needs a move
instruction capable of dealing with address units. Thus
\word{MOVE} has been defined and added to the Core word set,
and \word[string]{CMOVE} and \word[string]{CMOVEtop} have been
......@@ -3085,7 +3057,7 @@
the programmer with needing to know which words in a system
are immediate. Consequently, Forth standards have had to
specify the immediacy or non-immediacy of all words covered by
the Standard. This unnecessarily constrains implementors.
the standard. This unnecessarily constrains implementors.
A second problem with \texttt{COMPILE} is that some
programmers have come to expect and exploit a particular
......@@ -3104,7 +3076,7 @@
standards.
For these reasons, \texttt{COMPILE} has not been included in
the Standard and \word{[COMPILE]} has been moved in favor of
the standard and \word{[COMPILE]} has been moved in favor of
\word{POSTPONE}. Additional discussion can be found in Hayes,
J.R., ``Postpone'', \emph{Proceedings of the 1989 Rochester
Forth Conference}.
......@@ -3141,30 +3113,28 @@
\see \xref[3.4 The Forth text interpreter]{usage:command}.
\begin{implement}
\cbstart\patch{ed12}
\uline{\word{:} \word{QUIT}} \\
\tab \uline{\word{p} \textdf{empty the return stack and set the input source to the user input device} )} \\
\tab \uline{\word{POSTPONE} \word{[}} \\
\tab[2] \uline{\word{REFILL}} \\
\tab \uline{\word{WHILE}} \\
\tab[2] \uline{\word{[']} INTERPRET \word[exception]{CATCH}} \\
\tab[2] \uline{\word{CASE}} \\
\tab[2] \uline{~0 \word{OF} \word{STATE} \word{@} \word{0=} \word{IF}
\word{.q} OK" \word{THEN} \word{CR} \word{ENDOF}} \\
\tab[2] \uline{-1 \word{OF} \word{p} \textdf{Aborted} ) \word{ENDOF}} \\
\tab[2] \uline{-2 \word{OF} \word{p} \textdf{display message from \word{ABORTq}} ) \word{ENDOF}} \\
\tab[2] \uline{\word{p} \textdf{default} ) \word{DUP} \word{.q} Exception \# " \word{d}} \\
\tab[2] \uline{\word{ENDCASE}} \\
\tab \uline{\word{REPEAT} \word[tools]{BYE}} \\
\uline{\word{;}}
\word{:} \word{QUIT} \\
\tab \word{p} \textdf{empty the return stack and set the input source to the user input device} ) \\
\tab \word{POSTPONE} \word{[} \\
\tab[2] \word{REFILL} \\
\tab \word{WHILE} \\
\tab[2] \word{[']} INTERPRET \word[exception]{CATCH} \\
\tab[2] \word{CASE} \\
\tab[2] ~0 \word{OF} \word{STATE} \word{@} \word{0=} \word{IF}
\word{.q} OK" \word{THEN} \word{CR} \word{ENDOF} \\
\tab[2] -1 \word{OF} \word{p} \textdf{Aborted} ) \word{ENDOF} \\
\tab[2] -2 \word{OF} \word{p} \textdf{display message from \word{ABORTq}} ) \word{ENDOF} \\
\tab[2] \word{p} \textdf{default} ) \word{DUP} \word{.q} Exception \# " \word{d} \\
\tab[2] \word{ENDCASE} \\
\tab \word{REPEAT} \word[tools]{BYE} \\
\word{;}
\dffamily
\uline{%
This assumes the existence of a system-implementation word
{\tt INTERPRET} that embodies the text interpreter semantics described in}
\xref[3.4 The Forth text interpreter]{usage:command}.
\uline{Further discussion of the interpret loop can be found in \rref{core:COMPILE,}{}.}
\cbend
\texttt{INTERPRET} that embodies the text interpreter semantics
described in \xref[3.4 The Forth text interpreter]{usage:command}.
Further discussion of the interpret loop can be found in
\rref{core:COMPILE,}{}.
\end{implement}