Commit e4ce6922 authored by paysan's avatar paysan

My take at chapter 5

parent c5348e3a
......@@ -48,7 +48,7 @@ or
: SEE [ 2 FH ] LITERAL LIST ;
\end{Code}
A slightly more complicated version of \forth{FH} also lets you edit or
load a screen with a phrase such as ``\forth{14 FH LIST}'', relative to
load a screen with a phrase such as ``\forth{14 FH LIST},'' relative to
the screen that you just listed (\forth{SCR}):
\begin{Code}
: FH \ ( offset -- offset-block) "from here"
......
......@@ -503,7 +503,7 @@ not functionally bound. Next, ask these four questions about the
module:
\begin{enumerate}
\item Does the description have to be a compound sentence?
\item Does it use words involving time, such as ``first'', ``next'',
\item Does it use words involving time, such as ``first,'' ``next,''
``then,'' etc.?
\item Does it use a general or nonspecific object following the verb?
\item Does it use words like ``initialize'' which imply a lot of
......@@ -831,7 +831,7 @@ Thus we can write:
: DOIT
GETC TRANSFORM-TO-D PUT-D ;
\end{Code}
confident that \forth{GETC} will get ``C'', and leave it on the stack.
confident that \forth{GETC} will get ``C,'' and leave it on the stack.
\forth{TRANSFORM-TO-D} will pick up ``C'' from the stack, transform
it, and leave ``D'' on the stack. Finally, \forth{PUT-D} will pick up
``D'' on the stack and write it. \Forth{} eliminates the act of passing
......
......@@ -1538,7 +1538,7 @@ design!%
pp. 6-11.
\bibitem{weinberg80} \person{Victor Weinberg}, \emph{Structured Analysis,}
Englewood Cliffs, N.J.: Prentice-Hall, Inc., 1980.
\bibitem{stuart80} \person{LaFarr Stuart}, ``LaFORTH'',
\bibitem{stuart80} \person{LaFarr Stuart}, ``LaFORTH,''
\emph{1980 FORML Proceedings,} p. 78.
\bibitem{brooks75} \person{Frederick P. Brooks}, Jr., \emph{The Mythical
Man-Month,} Reading, Massachusetts, Addison-Wesley, 1975.
......
......@@ -1448,7 +1448,7 @@ Something like this:
So it turns out we \emph{do} have a doubly-nested \forthb{IF THEN}
construct after all. But it seems justified because the \forthb{IF THEN}
is handling the special case. The other is such a short phrase,
``\forth{IF FIVER THEN}'', it's hardly worth making into a separate
``\forth{IF FIVER THEN},'' it's hardly worth making into a separate
definition. You could though. (But we won't.)
Let's focus on the code for the special case. To state its algorithm: ``If
......
......@@ -34,7 +34,7 @@ for the preferences. In other words:
\begin{Code}
: TIP VALUE JUDGEMENT ;
\end{Code}
I'd especially like to thank Kim Harris,\index{H!Harris, Kim} who
I'd especially like to thank \person{Kim Harris},\index{H!Harris, Kim} who
proposed many of the conventions described in this chapter, for his
continuing efforts at unifying divergent views on good \Forth{} style.
......@@ -162,7 +162,7 @@ testing (necessary for the iterative approach). Like pages of a book,
each screen can be accessed individually and quickly. It's a ``random
access'' approach to source-code maintenance.
You can also replace any passage of code with anew, trial version by
You can also replace any passage of code with a new, trial version by
simply changing the screen numbers in the load screen. You don't have to
move large passages of source code around within a file.
......@@ -203,7 +203,7 @@ For instance, these two ``skip-line''s keep the definition of
encountering either right parenthesis:
\begin{Code}
\ : NUTATE ( x y z )
\ SWAP ROT ( NUTATE) ;
\ SWAP ROT (NUTATE) ;
\end{Code}
\forthb{\bs S} is pronounced ``skip-screen.'' It causes the \Forth{}
interpreter to stop interpreting the screen entirely, as though there
......@@ -267,7 +267,7 @@ relative screen numbers in the chapter- or section-load screens.
There are two ways to implement relative loading.
The most common is to define:
\begin{Code}
: +LOAD ( offset -- ) BLK @ + LOAD;
: +LOAD ( offset -- ) BLK @ + LOAD ;
\end{Code}
and
\begin{Code}
......@@ -282,7 +282,7 @@ The phrase
1 FH LOAD
\end{Code}
is read ``1 from here \forth{LOAD},'' and is equivalent
to \forth{1 + LOAD}.
to \forth{1 +LOAD}.
Similarly,
\begin{Code}
......@@ -546,8 +546,8 @@ thirty.
\subsection{Electives}%
\index{E!Electives|(}
Vendors of \Forth{} systems have a problem. If they want to include
every command that the customer might expect-words to control
graphics, printers, and other niceties-they often find that the system
every command that the customer might expect---words to control
graphics, printers, and other niceties---they often find that the system
has swollen to more than half the memory capacity of the computer,
leaving less room for serious programmers to compile their
applications.
......@@ -620,7 +620,7 @@ and eliminates possible confusion between dates and months.%
\index{S!Stamp|)}%
\index{D!Dates, representation of|)}
If your system has \forth{\bs} (``skip-line''-see \App{C}), you can
If your system has \forth{\bs} (``skip-line''---see \App{C}), you can
write the comment line like this:
\begin{Code}
\ Chapter name Screen Name -- pg.# JPJ 06/10/83
......@@ -730,7 +730,7 @@ BASE ! \ restore it
\noindent Sometimes an argument is passed on the stack from screen to
screen, such as the value returned by \forthb{BEGIN} or \forthb{IF} in a
multiscreen assembler definition, or the base address passed from one
defining word to another-see ``Compile-Time Factoring'' in \Chap{6}.
defining word to another---see ``Compile-Time Factoring'' in \Chap{6}.
In these cases, it's best to save the value of \forth{BASE} on the
return stack like this:
\begin{Code}
......@@ -826,12 +826,12 @@ Here are some common errors of spacing and indentation:
\end{Code}
\emph{Bad} (subsequent lines not indented three spaces):
\begin{Code}
: RIDDANCE (thing-never-to-darken-again -- )
: RIDDANCE ( thing-never-to-darken-again -- )
DARKEN NEVER AGAIN ;
\end{Code}
\emph{Good:}
\begin{Code}
: RIDDANCE (thing-never-to-darken-again -- )
: RIDDANCE ( thing-never-to-darken-again -- )
DARKEN NEVER AGAIN ;
\end{Code}
\emph{Bad} (lack of phrasing):
......@@ -1064,7 +1064,7 @@ acf & address of code field \\
apf & address of parameter field \\
' & (as prefix) address of \\
s d & (as a pair) source destination \\
lo hi & lower-limit upper-limit (inclusive, \\
lo hi & lower-limit upper-limit (inclusive) \\
\# & count \\
0 & offset \\
i & index \\
......@@ -1270,7 +1270,7 @@ line. For example:
: COLD \ restore system to start condition
... ;
\end{Code}
use the imperative mood: ``set Foreground color,'' not ``sets
Use the imperative mood: ``set Foreground color,'' not ``sets
Foreground color.''
On the other hand, a word's purpose can often be described in terms of
......@@ -1471,7 +1471,7 @@ The vertical format is preferred when a large team of programmers are
coding and maintaining the application. Typically, such a team will
include several junior-level programmers responsible for minor
corrections. In such an environment, diligent commenting can save a
lot of time and upset. As Johnson\index{J!Johnson, Dave} of Moore
lot of time and upset. As \person{Johnson}\index{J!Johnson, Dave} of Moore
Products Co. says: ``When maintaining code you are usually interested
in just one small section, and the more information written there the
better your chances for a speedy fix.''
......@@ -1524,7 +1524,7 @@ Despite these cautions, many companies find the vertical format
necessary. Certainly a team that is newly exposed to \Forth{} should
adopt it, as should any very large team.
What about the horizontal format? Perhaps it's an issue of art vs.
What about the horizontal format? Perhaps it's an issue of art vs.\@
practicality, but I feel compelled to defend the horizontal format as
equally valid and in some ways superior.
......
......@@ -666,7 +666,7 @@ Factor calculations algorithms out of definitions that display results.
This is really a question of decomposition.
Here's an example. The word defined below, pronounced
``people-to-paths'', computes how many paths of communication there are
``people-to-paths,'' computes how many paths of communication there are
between a given number of people in a group. (This is a good thing for
managers of programmer teams to know---the number of communication
paths increases drastically with each new addition to the team.)
......
......@@ -40,7 +40,7 @@ to sell out in favor of full-blown object oriented languages.
Some people have noted parallels between \emph{Thinking \Forth{}} and
Extreme Programming. For example, emphasis on iterative development,
incrementally enhancing code that ``works'', and not over-solving the
incrementally enhancing code that ``works,'' and not over-solving the
problem, and so on.
But in my opinion, Extreme Programming seems to miss an important step
......
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