]> thyrsus.com Git - mad.git/commitdiff
Added hyperlinks.
authorEric S. Raymond <esr@thyrsus,com>
Tue, 24 Feb 2004 06:05:55 +0000 (06:05 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Tue, 24 Feb 2004 06:05:55 +0000 (06:05 +0000)
doc/mad-manual.xml

index 075fd866886b33dd57841be85ce8b643f3052e62..cd166e2e4ea35cf0755bb34d089d93ebe7de561c 100644 (file)
@@ -1178,16 +1178,17 @@ digit punched in col. 11) the statement label need not be punched on
 the additional cards.</para>
 </sect2>
 
-<sect2 id='functions'><title>Functions</title>
+<sect2 id='functions'><title>Functions</title> 
+
 <para>The name of a function consists of one to six letters or digits
 followed by a period "." which must be written.  The first character
 of a function name must be a letter.  If the function is
 single-valued, then the value of the function is represented by
 following the function name by the proper number of arguments (see
-section 3.8 for the definition of function) separated by commas and
-enclosed in parentheses.  Thus, ADD51., COS., POLY., and FUNCT3. are
-function names, while ADD51. (X,Y,ADD.), POLY. (N, VJ, 7) and COS. (X)
-are values of functions.</para>
+<xref linkend='funcdefs'/> for the definition of function) separated
+by commas and enclosed in parentheses.  Thus, ADD51., COS., POLY., and
+FUNCT3. are function names, while ADD51. (X,Y,ADD.), POLY. (N, VJ, 7)
+and COS. (X) are values of functions.</para>
 </sect2>
 
 <sect2><title>Arithmetic Operations</title>
@@ -1476,16 +1477,17 @@ floating point mode if the expression were written:</para>
 <para>Of course, many times the expression will be written as
 originally stated just to achieve the "truncation" effect.</para>
 
-<para>A statement label (appearing in the label field of a statement) is a
-constant of statement label mode.  A function name with no arguments
-(e.g. SIN.) is a constant of a function name mode.  A single constant,
-variable, or function value of statement label (function name) mode is
-an expression of statement label (function name) mode.  There are no
-other expressions of statement label (function name) mode.  If A and B
-are both statement label (function name) expressions then A.E.B. and
-A.NE.B are Boolean expressions except when A or B are elements of a
-vactor which has been preset by a VECTOR VALUES statement (see section
-3.7).  In this exceptional case A.E.B. and A.NE.B are not expressions.</para>
+<para>A statement label (appearing in the label field of a statement)
+is a constant of statement label mode.  A function name with no
+arguments (e.g. SIN.) is a constant of a function name mode.  A single
+constant, variable, or function value of statement label (function
+name) mode is an expression of statement label (function name) mode.
+There are no other expressions of statement label (function name)
+mode.  If A and B are both statement label (function name) expressions
+then A.E.B. and A.NE.B are Boolean expressions except when A or B are
+elements of a vactor which has been preset by a VECTOR VALUES
+statement (see <xref linkend='VECTOR_VALUES'/>).  In this exceptional
+case A.E.B. and A.NE.B are not expressions.</para>
 </sect2>
 
 <sect2 id='subscripts'><title>Subscript Expressions</title>
@@ -1980,24 +1982,23 @@ This would appear as:</para>
 EXECUTE LSORT.(ARRAY, MAP, N)
 </programlisting>
 
-<para>(See section 3.8 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 statement if the function
-has no arguments.</para>
+<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
+statement if the function has no arguments.</para>
 
 </sect2>
 <sect2 id='ERROR_RETURN'><title>Error Return Statement</title>
 
 <para>Provision is made for including an error return in function
-definition programs (see section 3.8).  The form of the statement is
-simply:</para>
+definition programs (see <xref linkend='funcdefs'/>).  The form of the
+statement is simply:</para>
 
 <programlisting>
 ERROR RETURN
 </programlisting>
 
-<para>(An example of its use is shown near the end of subsection
-3.8.3).</para>
+<para>(An example of its use is shown near the end of subsection 3.8.3).</para>
 
 <para>In order to use it in a function evaluation, the last
 (right-most) argument of the function must be the label of a statement
@@ -2044,7 +2045,7 @@ FUNCTION RETURN &scriptN;
 return to the calling program.  &scriptN; is an expression whose value is to
 be the output of this function considered as a single valued function.
 &scriptN; need not be specified if outputs are specified in the argument list
-(see section 3.8).</para>
+(see <xref linkend='funcdefs'/>).</para>
 
 </sect2>
 <sect2><title>Entry to a function</title>
@@ -2055,19 +2056,20 @@ be the output of this function considered as a single valued function.
 ENTRY TO &scriptN;
 </programlisting>
 
-<para>where &scriptN; is the name of this entry (see section 3.8).</para>
+<para>where &scriptN; is the name of this entry (see <xref
+linkend='funcdefs'/>).</para>
 
 <note><para>The Retrocomputing Museum implementation supports only
 one entry point per function.  Attempting to specify more than one
 will raise a compile-time error.</para></note>
 
 </sect2>
-<sect2><title>List Manipulation Statements</title>
+<sect2 id='list_statements'><title>List Manipulation Statements</title>
 
-<para>These statements facilitate the writing of recursive internal and
-external functions.  (see section 3.8) They cause the designation and
-use of a vector for the temporary storage of data and action transfer
-instructions.  (i.e. function returns).</para>
+<para>These statements facilitate the writing of recursive internal
+and external functions.  (see <xref linkend='funcdefs'/>) They cause
+the designation and use of a vector for the temporary storage of data
+and action transfer instructions.  (i.e. function returns).</para>
 
 <orderedlist numeration='loweralpha'>
 <listitem>
@@ -2097,9 +2099,9 @@ currently available element.  &scriptL; is the same as any input-output list
 <para>SAVE RETURN</para>
 
 <para>This statement will appear in the scope of the definition of a
-function (see section 3.8) and cause the reentry point to the calling
-program to be stored as the next available element of the currently
-designated temporary storage vector.</para>
+function (see <xref linkend='funcdefs'/>) and cause the reentry point
+to the calling program to be stored as the next available element of
+the currently designated temporary storage vector.</para>
 </listitem>
 <listitem>
 <para>RESTORE DATA &scriptL;</para>
@@ -2305,8 +2307,8 @@ format specification, so the list may be empty.)  A format
 specification is a string of alphabetic characters (as <!-- beginpage
 --> described below) terminated by an "*".  This string is stored six
 characters per computer word in a vector with integer mode.  This
-vector may be preset (see section 3.7), computed, or read in as
-data.</para>
+vector may be preset (see <xref linkend='VECTOR_VALUES'/>), computed,
+or read in as data.</para>
 
 <sect3 id='carriage_control'><title>Carriage Control</title>
 
@@ -2867,15 +2869,15 @@ assigned statement label mode (see <xref
 linkend='statement_labels'/>).</para></listitem>
 
 <listitem><para>A function name constant is assigned function name mode (see
-<xref linkend='functions'/>).</para></listitem>
+<xref linkend='funcdefs'/>).</para></listitem>
 
 <listitem><para>A vector appearing as the dimension vector of some
 array in a dimension declaration is assigned integer mode (see <xref
 linkend='dimension_declaration'/>).</para></listitem>
 
-<listitem><para>A vector which is preset by a vector values declaration is
-assigned a mode consistent with the assigned values (see section 3.7).
-</para></listitem>
+<listitem><para>A vector which is preset by a vector values
+declaration is assigned a mode consistent with the assigned values
+(see <xref linkend='VECTOR_VALUES'/>).  </para></listitem>
 </orderedlist>
 
 </sect2>
@@ -2930,10 +2932,10 @@ is the name of the first element in the "dimension vector" for this
 array.  If this name is D(k) (k must be an integer constant), the
 vactor D is automatically assigned integer mode.  D may not be
 declared to be other than integer.  In addition, D must itself be
-dimensioned, either by declaration or by presetting its values
-(section 3.7) to have its largest linear subscript &le; k+n.  Assuming
-that elements of the array to be dimensioned are to be referred to as
-A(I<subscript>1</subscript>, I<subscript>2</subscript>,
+dimensioned, either by declaration or by presetting its values (<xref
+linkend='VECTOR_VALUES'/>) to have its largest linear subscript &le;
+k+n.  Assuming that elements of the array to be dimensioned are to be
+referred to as A(I<subscript>1</subscript>, I<subscript>2</subscript>,
 I<subscript>n</subscript>), the elements of the linear array D,
 i.e. D(k), D(k + 1), ...D(k + n), must be preset (or set during
 computation) to the values</para>
@@ -3012,11 +3014,13 @@ EQUIVALENCE (A,B), (MATRIX, XARRAY), (C, D(3))
 <para>and implies that the variables A and B are to represent the same
 storage location throughout the program, that MATRIX and XARRAY are to
 represent the same storage location through the program, etc.  (Two
-variables which represent the same location always have the same value
-at any given time.)  Thus, any number of equivalences may be
-established by one EQUIVALENCE declaration, and any number of such
-declarations may occur (at any place) in a program.  They will be
-treated as one combined declaration, however.</para>
+variables which
+<!-- beginpage -->
+represent the same location always have the same value at any given
+time.)  Thus, any number of equivalences may be established by one
+EQUIVALENCE declaration, and any number of such declarations may occur
+(at any place) in a program.  They will be treated as one combined
+declaration, however.</para>
 
 <para>Variables whose names appear within the same set of parentheses need
 not have the same mode.  The mode must be established by the
@@ -3035,7 +3039,7 @@ implies equating the entire arrays accordingly.</para>
 implement EQUIVALENCE.</para></note>
 
 </sect2>
-<sect2><title>ERASABLE Declaration</title>
+<sect2 id='ERASABLE'><title>ERASABLE Declaration</title>
 
 <para>This declaration has the form</para>
 
@@ -3047,11 +3051,13 @@ ERASABLE MATRIX, XARRAY, YARRAY
 word ERASABLE (which need not have the same number of dimensions) are
 disjoint (i.e., non-overlapping in storage), but are assigned to a
 special section of storage which is separate from the usual storage of
-variables and arrays.  Each ERASABLE declaration eliminates the effect
-of previous assignments to this special section of storage, thus
-allowing several arrays to occupy the same storage at different times.
-It should be understood that this storage is accessible to, andmay be
-used by, subroutines.</para>
+variables and 
+<!-- beginpage -->
+arrays.  Each ERASABLE declaration eliminates the effect of previous
+assignments to this special section of storage, thus allowing several
+arrays to occupy the same storage at different times.  It should be
+understood that this storage is accessible to, andmay be used by,
+subroutines.</para>
 
 <note><para>This declaration is a memory-footprint optimization hack.
 The Retrocomputing Museum implementation does not implement
@@ -3071,7 +3077,7 @@ words PROGRAM COMMON (which ned not have the same number of
 dimensions) are disjoint (i.e., non-overlapping in storage), but are
 assigned to a special section of storage which is separate from the
 usual storage of variables and arrays, and separate from ERASABLE
-storage (see section 3.5).</para>
+storage (see <xref linkend='ERASABLE'/>).</para>
 
 <para>One use of this statement provides for several sections or a program
 to refer to variables and arrays by the same names, while being
@@ -3114,7 +3120,7 @@ is used at all.</para>
 implement COMMON.</para></note>
 
 </sect2>
-<sect2><title>Presetting Vectors</title>
+<sect2 id='VECTOR_VALUES'><title>Presetting Vectors</title>
 
 <!-- The script L in this section is lowercase in the original -->
 <para>Any vector or portion of a vector (or array when considered as a
@@ -3166,36 +3172,41 @@ program, the PROGRAM COMMON region is identical in all sections of the
 program.</para>
 
 </sect2>
-<sect2><title>Function Definitions</title>
+<sect2 id='funcdefs'><title>Function Definitions</title>
+
+<!-- the xrefs here were in the form "subsection 3.8.x" in the original -->
 
 <para>There are two main types of functions: The <emphasis> internal
 </emphasis> function and the <emphasis> external </emphasis> function.
 Since these are quite similar in many ways, that part of the
-description which is specific to external functions will be given in
-subsection 3.8.1, that which is specific to internal functions in
-subsection 3.8.2, and that which is common to both types will follow
-in subsection 3.8.3.  Throughout this section a single-valued function
-will be called a "function", and a function with multiple outputs
-and/or multiple exits will be called a "procedure".  For the purposes
-of this manual a recursive function is one whose definition contains
-calls for the function being defined -- or calls for functions which
-ultimately call the one being defined.  Recursive functions have the
-same structure as other functions although, in general, they will
-include statements of the type described in section 2.13, and certain
+description which is specific to external functions
+<!-- beginpage -->
+will be given in <xref linkend='external_functions'/>, that which is
+specific to internal functions in <xref
+linkend='internal_functions'/>, and that which is common to both types
+will follow in subsection 3.8.3.  Throughout this section a
+single-valued function will be called a "function", and a function
+with multiple outputs and/or multiple exits will be called a
+"procedure".  For the purposes of this manual a recursive function is
+one whose definition contains calls for the function being defined --
+or calls for functions which ultimately call the one being defined.
+Recursive functions have the same structure as other functions
+although, in general, they will include statements of the type
+described in <xref linkend='list_statements'/>, and certain
 considerations should be borne in mind when constructing such
 functions.  These considerations arise from the fact that <emphasis>
 names </emphasis>, instead of values, are used as function arguments.
 The problem is considered in more detail in the examples in Chapter
 III.</para>
 
-<sect3><title>External Function Definitions</title>
+<sect3 id='external_functions'><title>External Function Definitions</title>
 
-<para>These statements define functions not yet available in the language or
-as standard package programs ("subroutines").  The designatyion
-"EXTERNAL" implies that the statements which follow are to be
-translated indpendently of the main program in which they are to be
-used.  (Because of this independence this block of statements is to be
-considered an entirely separate program, and must have its own
+<para>These statements define functions not yet available in the
+language or as standard package programs ("subroutines").  The
+designatyion "EXTERNAL" implies that the statements which follow are
+to be translated indpendently of the main program in which they are to
+be used.  (Because of this independence this block of statements is to
+be considered an entirely separate program, and must have its own
 DIMENSION and MODE declaration, etc.)  The word "EXTERNAL" also
 implies that occurrences of variables and functions in the current
 function definition program have no relation whatever with occurrences
@@ -3203,25 +3214,27 @@ of similarly named variables and function [typo] in the main program
 (or other definition programs), and no difficulties will be
 encountered because of the use of similar names.  The modes of the
 arguments (if other than the normal mode), must be declared in the
-usual way (see Section 3.2), but arrays which are arguments need not
-be dimensioned.</para>
+usual way (see <xref linkend='mode_declaration'/>), but arrays which
+are arguments need not be dimensioned.</para>
 
 </sect3>
-<sect3><title>Internal Function Definitions</title>
+<sect3 id='internal_functions'><title>Internal Function Definitions</title>
 
 <para>These statements define functions not yet available in the language or
 as standard package programs ("subroutines").  The designation
 "INTERNAL" implies that the definition program which follows is to be
 translated as part of the main program.  The word "INTERNAL" also
 implies that any variables or functions not listed as arguments in the
-definition of the function (but used in its evaluation), are
-understood to be the same as elsewhere in the main program, and the
-current values of these variables and functions will be used.  Names
-of variables and functions which occur as arguments of the function
-being defined are designated "dummy arguments" (or "bound variables").
-They must be distinct from those appearing elsewhere in the program.
-The modes of dummy arguments (if other than normal mode) must de
-declared in the usual way, but arrays which are arguments need not be
+definition of the
+<!-- beginpage -->
+function (but used in its evaluation), are understood to be the same
+as elsewhere in the main program, and the current values of these
+variables and functions will be used.  Names of variables and
+functions which occur as arguments of the function being defined are
+designated "dummy arguments" (or "bound variables").  They must be
+distinct from those appearing elsewhere in the program.  The modes of
+dummy arguments (if other than normal mode) must de declared in the
+usual way, but arrays which are arguments need not be
 dimensioned.</para>
 
 <para>One form of internal function definition (not available as an external
@@ -3232,7 +3245,9 @@ program) is the one sentence definition, which has the form:</para>
 INTERNAL FUNCTION SUMSQ.(X,Y,Z) = X * X + Y + Z * Z - T * T
 </para>
 
-<para>As indicated above, X, Y, and Z, as they occur here, are dummy variables, and (X, Y, Z) is the dummy variable list.</para>
+<para>As indicated above, X, Y, and Z, as they occur here, are dummy
+<!-- beginpage -->
+variables, and (X, Y, Z) is the dummy variable list.</para>
 </sect3>
 
 <!-- MORE GOES HERE -->