Commit 59f00d6c authored by paysan's avatar paysan

Fixed wrong PDF links

parent fcfe0c24
......@@ -25,8 +25,7 @@ state-of-the-art programming principles.
% These all need to be on page without the start of
% a range of the same name.
\index{C!Control structures:!minimization of|see{Control
structure minimization}}%
\index{C!Control structures:!minimization of|see{Control structure minimization}}%
\index{D!Data handling|see{Data stacks, Data structures}}%
\index{D!Data structures:|seealso{Variables}}%
\index{D!Design|see{Detailed design, Preliminary design}}%
......@@ -1064,7 +1063,7 @@ feature allows the data structures within a component to be described
in terms of previously-defined components. This feature is direct
access memory.
Suppose we define a variable called \forth{APPLES}, like this:\label{apples1}
Suppose we define a variable called \forth{APPLES}, like this:\program{apples1}
\begin{Code}
VARIABLE APPLES
\end{Code}
......@@ -1175,7 +1174,7 @@ GREEN APPLES ?
value in trying to determine what part of speech a particular word is,
since \Forth{} doesn't care anyway. We need only enjoy the ease of
describing an application in natural terms.%
\label{apples2}%
\program{apples2}%
\index{D!Data structures:!hiding construction of|)}
......
......@@ -798,7 +798,7 @@ practice, and I've had more practice.
\index{A!Analysis!rule definition|(}%
\index{C!Conceptual model!rule definition|(}%
\index{R!Rule definition|(}%
\label{phone1}
\program{phone1}
Most of your efforts at defining a problem will center on describing
the interface.%
......@@ -1126,7 +1126,7 @@ to a running \Forth{} application. But it is only pseudocode. We've
avoided stack manipulations by assuming that values will somehow be on
the stack where the comments indicate. Also, we've used hyphenated
names because they might be more readable for the customer. Short
names are preferred in real code---see \Chap{5}.)\label{phone2}
names are preferred in real code---see \Chap{5}.)\program{phone2}
We'll unveil the finished code for this example in \Chap{8}.%
\index{A!Analysis!decision table|)}%
......
......@@ -143,7 +143,7 @@ chance that it will change, you're better off hiding it behind a name:
\end{Code}
(The name \forth{/RECORD}, by convention, means ``bytes per record.'')
\section{Example: A Tiny Editor}\label{editor1}
\section{Example: A Tiny Editor}\program{editor1}
Let's apply decomposition by component to a real problem. It would be
nice to design a large application right here in \Chap{3}, but alas, we
......@@ -570,7 +570,7 @@ component. Also we used \forth{OVERWRITE} inside \forth{INSERT}.
By decomposing our application into components which use one another,
we achieved not only \emph{elegance} but a more direct path to
\emph{correctness}.\label{editor2}
\emph{correctness}.\program{editor2}
\section{The Interface Component}%
\index{I!Interface component|(}
......
......@@ -676,7 +676,7 @@ light-blue with 9. You want to define two words: \forth{BLUE} will return
1; \forth{LIGHT} may precede \forth{BLUE} to produce 9.
In \Forth{}, it would be possible to define \forth{BLUE} as a constant, so
that when executed it always returns 1.\label{color1}
that when executed it always returns 1.\program{color1}
\begin{Code}
1 CONSTANT BLUE
......@@ -988,7 +988,7 @@ structure:
& \emph{Full Rate} & \emph{Lower Rate} & \emph{Lowest Rate} \\ \hline
First Min. & .30 & .22 & .12 \\ \hline
Add'1 Mins. & .12 & .10 & .06 \\ \hline
\end{tabular}\label{phone3}
\end{tabular}\program{phone3}
\bigskip
\noindent Using a data structure was simpler than trying to invent a
......@@ -996,7 +996,7 @@ formula by which these values could be calculated. And the formula might
prove wrong later. In this case, table-driven code is easier to maintain.
In \Chap{3} we designed a keystroke interpreter for our Tiny
Editor using a decision table:\label{editor3}
Editor using a decision table:\program{editor3}
%!! this should be a table; see pg 119
%%typo: The original has here ``Cntrl''. Usually, it's Ctrl, and other chapters
......@@ -1057,7 +1057,7 @@ application.
\section{Solving a Problem: Computing Roman Numerals}%
\index{D!Detailed design!demonstration of|(}%
\index{R!Roman numeral computation problem|(}%
\label{roman1}
\program{roman1}
In this section we'll attempt to demonstrate the process of designing a
lexicon. Rather than merely present the problem and its solution, I'm
......@@ -1774,7 +1774,7 @@ VARIABLE COLUMN# ( current offset)
\label{fig-fig4-9}
\end{figure*}%
\index{R!Roman numeral computation problem|)}%
\label{roman2}
\program{roman2}
\section{Summary}
......
......@@ -333,7 +333,7 @@ If a series of definitions contains identical functions, with
variation only in data, use a defining word.
\end{tip}
Examine the structure of this code (without worrying about its
purpose---you'll see the same example later on):\label{color2}
purpose---you'll see the same example later on):\program{color2}
\begin{Code}
: HUE ( color -- color')
......@@ -718,7 +718,7 @@ We find another example of failing to factor the output function from
the calculation function in our own Roman numeral example in \Chap{4}.
Given our solution, we can't store a Roman numeral in a buffer or
even center it in a field. (A better approach would have been to use
\forthb{HOLD} instead of \forthb{EMIT}.)\label{roman3}
\forthb{HOLD} instead of \forthb{EMIT}.)\program{roman3}
Information hiding can also be a reason \emph{not} to factor. For
instance, if you factor the phrase
......@@ -922,7 +922,7 @@ We notice that the colors between 8 and 15 are all ``lighter''
versions of the colors between 0 and 7. (In the hardware, the only
difference between these two sets is the setting of the ``intensity
bit.'') If we factor out the ``lightness,'' we might come up with this
solution:\label{color3}
solution:\program{color3}
\begin{Code}
VARIABLE 'LIGHT? ( intensity bit?)
......@@ -954,7 +954,7 @@ If necessary for readability, we still might want to define:
14 HUE YELLOW
\end{Code}
Again, through this approach we've achieved a more pleasant syntax and
shorter object code.\label{color4}
shorter object code.\program{color4}
\index{C!Commands, reducing number of|)}
\begin{tip}
......@@ -1017,7 +1017,7 @@ We can also apply limited redundancy during compilation, by letting
For maximum maintainability, limit redundancy even at compile time.
\end{tip}
Suppose in our application we must draw nine boxes as shown in
\Fig{fig6-1}.\label{boxes1}
\Fig{fig6-1}.\program{boxes1}
\begin{figure*}[hhhh]
\caption{What we're supposed to display}
......@@ -1135,7 +1135,7 @@ coordinates in the table: this value becomes the constant
This construct lets you add or subtract points from the table without
worrying about the number of points there are. \Forth{} computes this
for you.\label{boxes2}
for you.\program{boxes2}
\subsection{Compile-Time Factoring through Defining Words}%
\index{D!Defining words:!compile-time factoring through}
......@@ -1243,7 +1243,7 @@ a box at a given x--y coordinate. (This is the same problem we
introduced in the section called ``Compile-Time Factoring.'')
At first we focus our attention on the problem of drawing a
box---never mind erasing it. We might come up with this:\label{boxes3}
box---never mind erasing it. We might come up with this:\program{boxes3}
\begin{Code}
: LAYER WIDE 0 DO ASCII * EMIT LOOP ;
......
......@@ -98,7 +98,7 @@ long-term consequences of the conditional.
Before we introduce some detailed techniques, let's look at three
approaches to the use of conditionals in a particular example.
\Fig{fig8-1}, \Fig{fig8-2}, and \Fig{fig8-3} illustrate three versions of
a design for an automatic teller machine.\label{teller1}
a design for an automatic teller machine.\program{teller1}
\begin{figure*}[tttt]
\verbfig{fig8-1}{The structured approach.}
......@@ -259,7 +259,7 @@ dependent on hardware. Details of the interface to the keypad may be
hidden within the keypad lexicon, \code{READ-BUTTON} and \code{BUTTON}.)
Of course, \Forth{} will allow you to take any of the three approaches.
Which do you prefer?\label{teller2}
Which do you prefer?\program{teller2}
\section{How to Eliminate Control Structures}
......@@ -1001,7 +1001,7 @@ Another example of the one-dimensional data table is the ``superstring''
\subsubsection{Two-Dimensional Data Table}%
\index{T!Two-dimensional data table|(}%
\label{phone4}
\program{phone4}
In \Chap{2} we presented a phone-rate problem. \Fig{fig8-4} gives one
solution to the problem, using a two-dimensional data structure.
......@@ -1062,11 +1062,11 @@ approach eliminates the need for a multiplication that would otherwise be
needed to implement a two-dimensional structure. The multiplication can be
prohibitively slow in certain cases.%
\index{T!Two-dimensional data table|)}%
\label{phone5}
\program{phone5}
\subsubsection{Two-Dimensional Decision Table}%
\index{T!Two-dimensional decision table|(}%
\label{editor4}
\program{editor4}
We'll hark back to our Tiny Editor example in \Chap{3} to illustrate
a two-dimensional decision table.
......@@ -1216,7 +1216,7 @@ manipulation. A simpler solution that uses no local variable is:
(We'll offer still another solution later in this chapter, under ``Using
Structured Exits.'')%
\index{T!Two-dimensional decision table|)}%
\label{editor5}
\program{editor5}
\section{Decision Tables for Speed}
......@@ -1628,7 +1628,7 @@ Criteria'' illustrates this point.
The purpose of the word \forth{LIGHT} is to set a flag which indicates
whether we want the intensity bit to be set or not. While we could have
written\label{color4}
written\program{color4}
\begin{Code}
: LIGHT TRUE 'LIGHT? ! ;
......@@ -1727,7 +1727,7 @@ DOER !' ( vectorable ! )
DOER CMOVE' ( vectorable CMOVE )
DOER FILL' ( vectorable FILL )
: STORING MAKE !' ! ;AND
MAKE CMOVE' CMOVE ; AND
MAKE CMOVE' CMOVE ;AND
MAKE FILL' FILL ;
: -STORING MAKE !' 2DROP ;AND
MAKE CMOVE' 2DROP DROP ;AND
......@@ -1790,7 +1790,7 @@ Because flags in memory are variables, they are not reentrant.
An example of a case in which we might reconsider the need for a flag is
one we've seen several times already. In our ``colors'' example we made
the assumption that the best syntax would be:\label{color5}
the assumption that the best syntax would be:\program{color5}
\begin{Code}
LIGHT BLUE
......
\chapter*{Preface}
\addcontentsline{toc}{section}{Preface}
\markboth{Preface}{Preface}
\pagestyle{headings}
\initial Programming computers can be crazy-making. Other professions give
......
\chapter*{Preface to the 2004 Edition}
\addcontentsline{toc}{section}{Preface to the 2004 Edition}
\markboth{Preface to the 2004 Edition}{Preface to the 2004 Edition}
\pagestyle{headings}
\initial It is an honor to find myself writing a preface again, twenty years
......
\chapter*{Preface to the 1994 Edition}
\addcontentsline{toc}{section}{Preface to the 1994 Edition}
\markboth{Preface to the 1994 Edition}{Preface to the 1994 Edition}
\pagestyle{headings}
\initial I'm honored that the \Forth{} Interest Group is reprinting
......
......@@ -114,6 +114,7 @@ footskip=.6in,marginparwidth=0.6in,marginparsep=0.1in}}
\newcommand{\labelsect}[1]{\label{sect-#1}}
\newcommand{\labelfig}[1]{\label{fig-#1}}
\newcommand{\program}[1]{\phantomsection\label{#1}}
\newcommand{\figref}[1]{\ref{fig-#1}}
\newcommand{\fig}[1]{Figure~\figref{#1}}
\newcommand{\Fig}[1]{Figure~\figref{#1}}
......@@ -403,6 +404,17 @@ shadowcolor=lightgrey,shadowsize=3pt,blur=true]{\unhbox\@tempboxa}%
\newcommand\THUGE{\@setfontsize\HUGE{65}{70}}
\newcounter{appendix}
\def\@schapter#1{\if@twocolumn
\@topnewpage[\@makeschapterhead{#1}]%
\else
\@makeschapterhead{#1}%
\@afterheading
\fi
\phantomsection
\addcontentsline{toc}{section}{#1}%
\chaptermark{#1}%
}
\def\@makechapterhead#1{{\HUGE
% \sffamily
\fontfamily{phv}\selectfont\bfseries\slshape
......@@ -450,6 +462,7 @@ Five\or Six\or Seven\or Eight\or Nine\or Ten\fi}
\twocolumn[\@makeschapterhead{\indexname}]%
\@mkboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\phantomsection
\addcontentsline{toc}{chapter}{\indexname}%
\thispagestyle{plain}\parindent\z@
\parskip\z@ \@plus .3\p@\relax
......@@ -590,6 +603,18 @@ samepage=true,xleftmargin=0em,xrightmargin=0em,baselinestretch=0.8}
%% table of contents style
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\def\@upperskip{1.5em \@plus\p@}
\def\@lowerskip{1.0em \@plus\p@}
......@@ -687,11 +712,6 @@ samepage=true,xleftmargin=0em,xrightmargin=0em,baselinestretch=0.8}
\@afterheading
\fi}
\iflatextoc
\else
\setcounter{tocdepth}{1}
\fi
% no indent after section start
\let\@afterindenttrue\@afterindentfalse
......
\cleardoublepage
\pagestyle{headings}\markboth{Contents}{Contents}
\addcontentsline{toc}{section}{\contentsname}%
\pagestyle{headings}
\setcounter{tocdepth}{1}
\tableofcontents
\clearpage
\begin{tabular}{ll}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment