]> thyrsus.com Git - mad.git/commitdiff
Explanation of the transcription style.
authorEric S. Raymond <esr@thyrsus,com>
Thu, 24 Jun 2004 23:05:31 +0000 (23:05 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Thu, 24 Jun 2004 23:05:31 +0000 (23:05 +0000)
doc/mad-manual.xml

index c4eee654a5a9b32374e3ed1f9baacd1b741d921c..c65726d9f5913877d0ffc8691bc52554f4129479 100644 (file)
@@ -323,6 +323,21 @@ velo-bound typed manual; Eric Raymond hand-corrected it, and moved the
 result into PIC and XML-DocBook markup so both HTML and PostScript can
 be generated from it.</para>
 
+<para>The philosophy of this transcription is that the semantic
+content of the manual is what is essential and is what should be
+presented by rendering into HTML; the accidents of literal content
+have in some cases been changed but should be reconstructable by
+looking at the XML source transcription.  Thus, typos have been fixed in the
+visible text, but the XML source includes a note adjacent to each one
+explaining the fix. We have also corrected other minor errors like
+off-by-ones in the indexing, but those fixes too are explained in the
+XML masters.</para>
+
+<para>We have been (necessarily) a little more relaxed about changes
+in whitespace distribution, as DocBook doesn't give us the ability to
+control that exactly.  Other notes in the XML source describe the few
+places where we were not able to reproduce the original layout.</para>
+
 <note><para>Redactor's comments in the body of the text are
 decorated like this.</para></note>
 
@@ -446,10 +461,10 @@ the original.  Notably, "section 1.1" becomes "Section 1.1"
 <para>The reference structure of the index has been faithfully
 reproduced; that is, for each index reference a DocBook
 &lt;indexterm&gt; tag was placed within the span of text defined by
-the original page numbering.  However, DocBook renders the index
-differently from the original.  The original lacked the canned section
-headings, and references were by page number rather than section
-name.</para>
+the original page numbering (two off-by-one errors were corrected).
+However, DocBook renders the index differently from the original.  The
+original lacked the canned section headings, and references were by
+page number rather than section name.</para>
 
 <para>EPSLON and COMPLX and the like are not typos.  As pointed out
 earlier, MAD variable names are limited to the 6 characters in a
@@ -775,6 +790,8 @@ interpreted in the sense: Whenever the following condition (in this
 case Z &lt; a<subscript>j</subscript>) is satisfied, do the specified
 action (Z = a<subscript>j</subscript>), otherwise just go on.</para>
 
+<indexterm><primary>Floating Point</primary></indexterm>
+
 <para>It is interesting to ask just how complicated a condition can be
 used in making decisions.  We have seen that such conditions may occur
 in iterations statements, and "WHENEVER" statements, etc., for the
@@ -822,6 +839,7 @@ available for use in any other program, as a pre-packaged "function",
 in the sense that, given n and a<subscript>0</subscript>, ...,
 a<subscript>n</subscript>, this function computes as its value the
 largest of a<subscript>0</subscript>, ..., a<subscript>n</subscript>.
+<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm>
 In this case we shall call our algorithm an EXTERNAL FUNCTION, and
 give it a name, say MAX., since it will be written and translated
 externally with respect to the program which will later call upon it.
@@ -1155,20 +1173,22 @@ of MAD implements the original MAD behavior.</para></note>
 <sect3><title>Floating Point Constants</title>
 
 <indexterm><primary>Constants, Floating Point</primary></indexterm>
+<indexterm><primary>Floating Point</primary></indexterm>
 
 <para>Floating point constants may be written with or without
-exponents.  If written without an exponent, the constant contains from
-one to eight digits and a decimal point ".", which must be written,
-but which may appear anywhere in the number.  Thus, 0., 1.5, -0.05,
-+100.0, .1 and -4. are all floating-point constants.  If the number is
-written with an exponent, it must contain from one to eight digits
-with or without a decimal point, followed by the letter "E", followed
-by the exponent of the power of 10 that multiplies the number.  (If
-the decimal point is omitted, it is assumed to be immediately to the
-left of the letter "E".)  The exponent m consists of one or two digits
-preceded by a sign (although a "+" sign may be omitted), and must
-satisfy the condition -38 &ge; m &ge; 38.  Examples of floating-point
-constants with exponent are; 
+exponents.  <indexterm><primary>Exponent</primary></indexterm> If
+written without an exponent, the constant contains from one to eight
+digits and a decimal point ".", which must be written, but which may
+appear anywhere in the number.  Thus, 0., 1.5, -0.05, +100.0, .1 and
+-4. are all floating-point constants.  If the number is written with
+an exponent, it must contain from one to eight digits with or without
+a decimal point, followed by the letter "E", followed by the exponent
+of the power of 10 that multiplies the number.  (If the decimal point
+is omitted, it is assumed to be immediately to the left of the letter
+"E".)  The exponent m consists of one or two digits preceded by a sign
+(although a "+" sign may be omitted), and must satisfy the condition
+-38 &ge; m &ge; 38.  Examples of floating-point constants with
+exponent are;
 
 <!-- beginpage II.2 -->
 
@@ -1291,7 +1311,7 @@ if Z5 = 7, and D = 3, the Z5 = D will have the value 2.
 <!-- beginpage II.4 -->
 <listitem><para>Exponentiation, written as ".P.", e.g., Z5.P.D, and
 meaning (Z5)<superscript>D</superscript>, i.e., Z5 raised to the power
-D.</para></listitem>
+D.<indexterm><primary>Exponentiation</primary></indexterm></para></listitem>
 
 <listitem><para>Negation, written as "-", e.g., -ALOHA, meaning the
 "negative of ALOHA."  Thus -X.P.-.5
@@ -1303,6 +1323,8 @@ means -(X<superscript>-.5</superscript>).
 
 <sect2><title>Arithmetic Expressions</title>
 
+<indexterm><primary>Expression, Arithmetic</primary></indexterm>
+
 <para>Arithmetic expressions<indexterm><primary>Arithmetic
 Expressions</primary></indexterm> are defined inductively as
 follows:</para>
@@ -1348,7 +1370,8 @@ value 1B and P has the value 0B.</para></listitem>
 <!-- beginpage II.5 -->
 
 <listitem><para>M.EQV.P has the value 1B if and only if M and P have
-the same values.</para></listitem>
+the same values.  <indexterm><primary>.EQV.</primary></indexterm>
+</para></listitem>
 </orderedlist>
 
 <para>Thus, .NOT., .OR., .AND., .THEN., AND .EQV. correspond to the
@@ -1357,6 +1380,8 @@ usual logical operations, ~, &or;, &and;, &sup;, and &equiv;.</para>
 
 <sect2 id='boolean_expressions'><title>Boolean Expressions</title>
 
+<indexterm><primary>Expression, Boolean</primary></indexterm>
+
 <para>Boolean expressions are defined inductively as follows:
 <indexterm><primary>Boolean Expressions</primary></indexterm>
 </para>
@@ -1439,6 +1464,8 @@ otherwise indicated by parentheses.</para>
 <!-- beginpage II.7 -->
 <para>Examples:</para>
 
+<indexterm><primary>Expression, Compound</primary></indexterm>
+
 <orderedlist>
 <listitem><para>A + B - C + D - E means (((A + B) - C) + D) - E.</para></listitem>
 <listitem><para>X/Z * Y/R * S means (((X/Z) * Y/R) * S.</para></listitem>
@@ -1547,7 +1574,8 @@ I<subscript>3</subscript> will be automatically converted to floating
 point before adding.  Likewise, in the next step, 
 <!-- beginpage II.9 -->
 the integer T<subscript>2</subscript> will be converted to floating
-point before adding to the floating point number.</para>
+point before adding to the floating point number.
+<indexterm><primary>Floating Point Subscript</primary></indexterm></para>
 
 <para>In other words, although the mode of the expression is floating
 point because of the presence of the floating point variable Y, some
@@ -1598,6 +1626,8 @@ MP(A, B + 6 * J, I * 6/TDX), MA(K(Z + 5) + T(1) + 6).</para>
 
 <sect1><title>Statements (Executable)</title>
 
+<indexterm><primary>Executable Statements</primary></indexterm>
+
 <sect2 id='substitution'><title>Substitution Statement</title>
 
 <!-- beginpage II.10 -->
@@ -1608,15 +1638,15 @@ ALPHA = Y + Z + F.(X, Y, Z)
 </para>
 
 <para>That is, the left side of the "=" sign
-<indexterm><primary>Equals Sign</primary></indexterm> consists
-of the name of a variable (either an individual variable or a
-subscripted array variable), and the right side consists of any
-expression of the same mode.  The only exceptions to this mode
-requirement are the cases: (1) If the variable on the left is of
-integer mode then the value of a floating point expression of the
-right will be converted to integer mode.
-<indexterm><primary>Conversion, Floating Point to
-Integer</primary></indexterm> (2) if the variable on the left is of
+<indexterm><primary>Equals Sign</primary></indexterm> consists of the
+name of a variable (either an individual variable or a subscripted
+array variable), and the right side consists of any expression of the
+same mode.  The only exceptions to this mode requirement are the
+cases: (1) If the variable on the left is of integer mode then the
+value of a floating point expression of the right will be converted to
+integer mode.  <indexterm><primary>Conversion, Floating Point to
+Integer</primary></indexterm> <indexterm><primary>Floating Point
+Conversion</primary></indexterm> (2) if the variable on the left is of
 floating point mode then the value of an integer expression on the
 right will be converted to floating point mode.
 <indexterm><primary>Conversion, Integer to Floating
@@ -2089,6 +2119,8 @@ This would appear as:</para>
 EXECUTE LSORT.(ARRAY, MAP, N)
 </programlisting>
 
+<indexterm><primary>EXECUTE Statement</primary></indexterm>
+
 <para>(See <xref linkend='funcdefs'/> for definition of functions).
 Here ARRAY, MAP, N are the "arguments" of the function (subroutine)
 LSORT.  Arguments and parentheses may be omitted in an EXECUTE
@@ -2105,6 +2137,8 @@ statement is simply:</para>
 ERROR RETURN
 </programlisting>
 
+<indexterm><primary>ERROR RETURN Statement</primary></indexterm>
+
 <para>(An example of its use is shown near the end of <xref
 linkend='internal_and_external'/>).</para>
 
@@ -2378,7 +2412,8 @@ made even if at load point.</para>
 tape check, etc.) occurs during any input-output statement except READ
 DRUM or WRITE DRUM, the subroutine ERROR. is automatically entered.
 The subroutine ERROR. sets an error flag and returns control to the
-system in which the translated program is imbedded.</para>
+system in which the translated program is imbedded.
+<indexterm><primary>ERROR Subroutine</primary></indexterm></para>
 
 <para>If an end-of-file is encountered while executed a READ FORMAT,
 READ BCD TAPE, or READ BINARY TAPE statement the subroutine SYSTEM. (a
@@ -2553,16 +2588,36 @@ external medium as follows:</para>
 <informaltable frame='none' colsep='0' rowsep='0'>
 <tgroup cols='2'>
 <tbody>
-<row><entry>S</entry>  <entry>Skip (or blank information)</entry></row>
-<row><entry>I</entry>  <entry>Integer</entry></row>
-<row><entry>F</entry>  <entry>Fixed point number (Internally floating point)</entry></row>
+<row>
+  <entry>S
+    <indexterm><primary>S Field (Format)</primary></indexterm>
+  </entry>
+  <entry>Skip (or blank information)</entry>
+</row>
+<row>
+  <entry>I
+    <indexterm><primary>I Field (Format)</primary></indexterm>
+  </entry>
+  <entry>Integer</entry>
+</row>
+<row>
+  <entry>F
+    <indexterm><primary>F Field (Format)</primary></indexterm>
+  </entry>
+  <entry>Fixed point number (Internally floating point)</entry>
+</row>
 <row>
   <entry>E
      <indexterm><primary>E Field (Format)</primary></indexterm>
   </entry>
   <entry>Floating point number</entry>
 </row>
-<row><entry>K</entry>  <entry>Octal number</entry></row>
+<row>
+  <entry>K
+    <indexterm><primary>K Field (Format)</primary></indexterm>
+  </entry>
+  <entry>Octal number</entry>
+</row>
 <row>
   <entry>C
     <indexterm><primary>C Field (Format)</primary></indexterm>
@@ -3341,6 +3396,7 @@ identical in all sections of the program.</para>
 
 <para>There are two main types of functions: The <emphasis> internal
 </emphasis> function and the <emphasis> external </emphasis> function.
+<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm>
 Since these are quite similar in many ways, that part of the
 description which is specific to external functions will be 
 <!-- beginpage II.42 -->
@@ -3364,6 +3420,8 @@ III.</para>
 
 <sect3 id='external_functions'><title>External Function Definitions</title>
 
+<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm>
+
 <!-- In the original, "variables and functions in the main program"
 was typoed as "variables and function in the main program" (incorrect
 singular).  --> 
@@ -3421,12 +3479,11 @@ INTERNAL FUNCTION SUMSQ.(X,Y,Z) = X * X + Y + Z * Z - T * T
 
 <para>As indicated above, X, Y, and Z, as they occur here, are dummy
 <!-- beginpage II.44 -->
-
 variables, and (X, Y, Z) is the dummy
- variable<indexterm><primary>Dummy Arguments</primary></indexterm>
- list. The current value of T, however, will be obtained and used each
- time the value of the function is needed.  An example of theuse of
- the function so defined would be:</para>
+variable<indexterm><primary>Dummy Arguments</primary></indexterm>
+list. The current value of T, however, will be obtained and used each
+time the value of the function is needed.  An example of theuse of
+the function so defined would be:</para>
 
 <para role='centered'>
 A = 1.-SUMSQ. (U, V + 3, W) .P..5
@@ -3521,29 +3578,33 @@ END OF FUNCTION
 
 <para>The first statement (INTERNAL FUNCTION (X)) is a function
 declaration (i.e., <emphasis>declares</emphasis> that the following
-statements define a function).  If this is defining an external
-function, the declaration would be EXTERNAL FUNCTION (X).  Following
-the words INTERNAL (or EXTERNAL) FUNCTION is the dummy variable list
-((X) in this example).  The END OF FUNCTION declaration is the last
-statement in the function definition program.  (In an external 
-<!-- beginpage II.46 --> 
-function definition this is also the last statement in the program.)
-An entry must provided for each function being defined, but several
-functions may share any number of FUNCTION RETURN statements.  An
-entry statement merely marks a point of entry, and does not effect the
-sequence of computation in any way.  The expression after the word
-"RETURN" indicates that on this return the value of the function is to
-be the value of that expression. This expression must agree in mode
-with the function whose value it supplies; this agreement is not
-checked.  The definitions of functions whose calls are intended to be
-included in expressions must have an expression following the FUNCTION
-RETURN statement.  If the calls for a function are to appear in an
-EXECUTE STATEMENT (generally such functions have multiple outputs) the
+statements define a function).  
+<!-- erroneously refrred to II.44  -->
+<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm>
+If this is defining an external function, the declaration would be
+EXTERNAL FUNCTION (X).  Following the words INTERNAL (or EXTERNAL)
+FUNCTION is the dummy variable list ((X) in this example).  The END OF
+FUNCTION declaration is the last statement in the function definition
+program.  (In an external <!-- beginpage II.46 --> function definition
+this is also the last statement in the program.)  An entry must
+provided for each function being defined, but several functions may
+share any number of FUNCTION RETURN statements.  An entry statement
+merely marks a point of entry, and does not effect the sequence of
+computation in any way.  The expression after the word "RETURN"
+indicates that on this return the value of the function is to be the
+value of that expression. This expression must agree in mode with the
+function whose value it supplies; this agreement is not checked.  The
+definitions of functions whose calls are intended to be included in
+expressions must have an expression following the FUNCTION RETURN
+statement.  If the calls for a function are to appear in an EXECUTE
+STATEMENT (generally such functions have multiple outputs) the
 FUNCTION RETURN statement may appear without an accompanying
 expression.</para>
 
 <para>An example of a definition for procedures is as follows:</para>
 
+<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm>
+
 <programlisting>
 EXTERNAL FUNCTION (M, N, I, P, Q)
 STATEMENT LABEL N, I
@@ -3633,11 +3694,13 @@ flag set.  If</para>
 </programlisting>
 
 <para>is part of a program and Y &le; 0, then when the ERROR RETURN
-statement is executed control transfers to statement ER (then goes on
-to L), instead of finishing the execution of statement F (and then
-going on to S).  Note that the END OF FUNCTION statement will never be
-executed, but must be present in the definition.</para>
+statement is executed <indexterm><primary>ERROR RETURN
+Statement</primary></indexterm> control transfers to statement ER
+(then goes on to L), instead of finishing the execution of statement F
+(and then going on to S).  Note that the END OF FUNCTION statement
+will never be executed, but must be present in the definition.</para>
 <indexterm><primary>END OF FUNCTION Statement</primary></indexterm>
+
 </sect3>
 </sect2>
 </sect1>
@@ -3666,6 +3729,7 @@ in Chapter 4).</para>
        TAPEWR.         PUNCH.                          SETERR.
 </programlisting>
 <indexterm><primary>COMMNT Subroutine</primary></indexterm>
+<indexterm><primary>ERROR Subroutine</primary></indexterm>
 <!-- beginpage II.49 -->
 
 <para>If a block designation
@@ -3715,6 +3779,8 @@ relation is true.</para>
 
 <sect1><title>Scientific Examples</title>
 
+<indexterm><primary>Examples, Scientific</primary></indexterm>
+
 <sect2><title>Example 1<emphasis role='note'>: Compute roots of linear
 and quadratic equations</emphasis></title>
 
@@ -4219,6 +4285,7 @@ compile this example.  The problem is the array I/O.</para></note>
 <sect1><title>Business Data Processing Examples</title>
 
 <indexterm><primary>Business Data Processing Examples</primary></indexterm>
+<indexterm><primary>Examples, Business Data Processing</primary></indexterm>
 
 <sect2><title>Example 1<emphasis role='note'>: Payroll Processing</emphasis></title>
 
@@ -4655,6 +4722,9 @@ compile this example.  The problem is the array I/O.</para></note>
 <sect1><title>Symbol Manipulation and Recursive Function Examples</title>
 <sect2><title><emphasis role='note'>Example 1: Find a word in a string</emphasis></title>
 
+<indexterm><primary>Exammples, Recursive Functions</primary></indexterm>
+<indexterm><primary>Examples, Symbol Manipulation</primary></indexterm>
+
 <para><emphasis>Problem:</emphasis> Find the first occurrence of an
 arbitrary word in a given text.</para>
 
@@ -4991,11 +5061,14 @@ routine.  <indexterm><primary>END OF PROGRAM Statement</primary></indexterm>
 
 <varlistentry>
 <term>ERROR</term> 
+
 <listitem><para>Entry to this routine also causes a return to the
 operating system.  However, if a dump of storage was requested of the
 operating system such a print of storage will be produced before the
 return to the system.  The ERROR RETURN statement may produce a call
-for this routine.</para></listitem>
+for this routine.<indexterm><primary>ERROR RETURN
+Statement</primary></indexterm> <indexterm><primary>ERROR
+Subroutine</primary></indexterm> </para></listitem>
 </varlistentry>
 
 <varlistentry>