]> thyrsus.com Git - mad.git/commitdiff
Added crossrefs.
authorEric S. Raymond <esr@thyrsus,com>
Wed, 18 Feb 2004 06:22:44 +0000 (06:22 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Wed, 18 Feb 2004 06:22:44 +0000 (06:22 +0000)
doc/mad-manual.xml

index 54326aa97597b66277346e9155cdfdb2cb22d70f..154aac4d47f1b61c43e6aa238af7c27b7975f6ca 100644 (file)
@@ -154,8 +154,9 @@ pass-by-reference, and given that all variables are global it is
 difficult to imagine code that would.</para>
 
 <para>Label arrays, array-mode variables, and the associated
-computed-transfer statement are not implemented.  Neither are multiple
-ENTRY points, or TAPE and DRUM statements.</para>
+computed-transfer statement are not implemented (mainly because the
+manual did not include programs with which they could be tested).
+Neither are multiple ENTRY points, or TAPE and DRUM statements.</para>
 
 <para>Only the no-argument case of ERROR RETURN is supported.  The
 language describing the more general case of this feature is deeply
@@ -202,8 +203,9 @@ typewriters of the period did not have.  This distinction has been
 added in the present text.</para>
 
 <para>Some program listings in the original were missing continuation
-punches required by the language.  These have been corrected, and the
-corrections noted in XML coments.</para>
+punches that appear to be required by the language; this was probably
+due to transcription errors in the original.  These have been
+corrected, and the corrections noted in XML comments.</para>
 
 <para>Most of the original listings were typed so there was whitespace
 between remark or continuation punches and following statements or
@@ -1004,25 +1006,27 @@ internally as $ABCD&squ;&squ;$
 
 <para>The name of a variable consists of one to six letters or digits,
 the first of which must be a letter.  If the variable is defined as an
-n-dimensional array variable (see section 3.3) then the name of an
-element of the array consists of the variable name, (i.e one to six
-letters or digits, starting with a letter), followed by the
-appropriate subscripts separated by commas and enclosed in
-parentheses. Thus the following are "single variables:": X51, ALPHA6,
-LAMBDA, GROSS, while the following are elements of arrays: BETA(C1,
-C2, 6), X15(Y, Z1), J(6), J(Z1 + 5 *Z2, 5). (See <xref
-linkend='subscripts'/> for the description of subscripts.) Parentheses
-enclosing subscripts may not be <!-- beginpage --> omitted.</para>
+n-dimensional array variable (see <xref
+linkend='dimension_declaration'/>) then the name of an element of the
+array consists of the variable name, (i.e one to six letters or
+digits, starting with a letter), followed by the appropriate
+subscripts separated by commas and enclosed in parentheses. Thus the
+following are "single variables:": X51, ALPHA6, LAMBDA, GROSS, while
+the following are elements of arrays: BETA(C1, C2, 6), X15(Y, Z1),
+J(6), J(Z1 + 5 *Z2, 5). (See <xref linkend='subscripts'/> for the
+description of subscripts.) Parentheses enclosing subscripts may not
+be <!-- beginpage --> omitted.</para>
 </sect2>
 
 <!-- begin page -->
 
-<sect2><title>Statement Labels</title> <para>A statement may be
-labelled or unlabelled.  Labels are used to refer to a statement in
-other statements.  A statement label consists of from one to six
-letters or digits, the first of which must be a letter, e.g. IN or
-BACK.  A statement label may be an element of a statement label
-vector, in which case the vector name is followed by a
+<sect2 id='statement_labels'><title>Statement Labels</title> 
+
+<para>A statement may be labelled or unlabelled.  Labels are used to
+refer to a statement in other statements.  A statement label consists
+of from one to six letters or digits, the first of which must be a
+letter, e.g. IN or BACK.  A statement label may be an element of a
+statement label vector, in which case the vector name is followed by a
 <emphasis>constant</emphasis> integer subscript enclosed in
 parentheses, e.g. S(2) or LBL(3).  A statement label appears in the
 label field (i.e. columns 1-10) of the statement it identifies.  When
@@ -1133,7 +1137,7 @@ usual logical operations, ~, &or;, &and;, &sup;, and &equiv;.</para>
 <listitem><para>Boolean constants, Boolean individual variables,
 Boolean subscripted array variables and Boolean-valued functions are
 Boolean expressions.  (see <xref linkend="functions"/> and
-section 3.2).</para></listitem>
+<xref linkend='mode_declaration'/>).</para></listitem>
 
 <listitem><para>If H and F are arithmetic expressions: then H.L.F.,
 H.LE.F, H.E.F., H.NE.F, H.G.F., H.GE.F, are Boolean
@@ -1219,8 +1223,8 @@ function value is determined by its mode.  There are five modes in
 MAD; floating point, integer, Boolean, statement label, and function
 name.  Floating point, integer, and Boolean constants were described
 in <xref linkend='constants'/>.  Alphabetic constants are assumed to
-be of integer mode.  Section 3.2 describes how the modes of variables
-and functions are specified.</para>
+be of integer mode.  <xref linkend='mode_declaration'/> describes how
+the modes of variables and functions are specified.</para>
 
 <para>If an expression consists entirely of one constant, one
 variable, or one function value, the mode is that of the constant,
@@ -1688,7 +1692,8 @@ used for incrementing, testing, etc.</para>
   POLY  Y = X * Y + C(J)
 </programlisting>
   
-<para>(For the meaning of the statement INTEGER J,N see section 3.2).</para>
+<para>(For the meaning of the statement INTEGER J,N see <xref
+linkend='mode_declaration'/>).</para>
 
 <para>(ii) A Newton's Method solution (X<subscript>k+1</subscript> =
 x<subscript>k</subscript> -
@@ -1834,7 +1839,7 @@ and parentheses may be omitted in an EXECUTE statement if the function
 has no arguments.</para>
 
 </sect2>
-<sect2><title>Error Return Statement</title>
+<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
@@ -1964,23 +1969,24 @@ available for use by successive SAVE statements.</para>
 
 <para>In this section the follwing definition the following
 definitions will hold.  &scriptF; is the location of a format
-specification vector (see section 2.15) which must be an integer
-variable name. &scriptN; is an expression whose value is to be either
-a tape number or a drum number.  &scriptL; is an input-output list.
-Elements of &scriptL; may be: 1) single variable names or array names
-with subscripts;, 2) blocks of the form A(i<subscript>i</subscript>,
-..., i<subscript>n</subscript>) ... A(j<subscript>i</subscript>,
-...j<subscript>n</subscript>) where the i's and j's may be any
-subscript expression and n &ge; 1.  In addition, when &scriptL;
-designates an output list, the elements of &scriptL; may be: 3)
-constants or 4) expressions.  Elements of a list are separated by
-commas.  Example of an output list: AB, D, 2.5, MTX(1) ... MTX(N),
-P(14), J(I, K).  Example of a list which may be ysed either for input
-or output: A, B, K(3), J(25*I - L), A(K+1)... A(L*2).  To completely
-understand the operation of statements which make an explicit
-reference to "TAPE" or "DRUM" it is advisable to read the sections of
-the IBM 704 Reference Manual which describes the operation of these
-units (See <emphasis>Restrictions</emphasis> below).</para>
+specification vector (see <xref linkend='format_specs'/>) which must
+be an integer variable name. &scriptN; is an expression whose value is
+to be either a tape number or a drum number.  &scriptL; is an
+input-output list.  Elements of &scriptL; may be: 1) single variable
+names or array names with subscripts;, 2) blocks of the form
+A(i<subscript>i</subscript>, ..., i<subscript>n</subscript>)
+... A(j<subscript>i</subscript>, ...j<subscript>n</subscript>) where
+the i's and j's may be any subscript expression and n &ge; 1.  In
+addition, when &scriptL; designates an output list, the elements of
+&scriptL; may be: 3) constants or 4) expressions.  Elements of a list
+are separated by commas.  Example of an output list: AB, D, 2.5,
+MTX(1) ... MTX(N), P(14), J(I, K).  Example of a list which may be
+ysed either for input or output: A, B, K(3), J(25*I - L),
+A(K+1)... A(L*2).  To completely understand the operation of
+statements which make an explicit reference to "TAPE" or "DRUM" it is
+advisable to read the sections of the IBM 704 Reference Manual which
+describes the operation of these units (See
+<emphasis>Restrictions</emphasis> below).</para>
 
 <variablelist>
 <varlistentry>
@@ -2117,7 +2123,8 @@ specified by the latest execution of SETETT.), i.e., each setting
 cancels the previous one.</para>
 </sect3>
 </sect2>
-<sect2><title>FORMAT SPECIFICATIONS</title>
+<sect2 id='format_specs'><title>Format Specifications</title>
+<!-- in the original this title, unlike other sect2s, was all-capsed -->
 
 <para>When information is read from (or punched in) a card into (or from) a
 computer, it is necessary to know how this information has been
@@ -2135,7 +2142,7 @@ 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>
 
-<sect3><title>Carriage Control</title>
+<sect3 id='carriage_control'><title>Carriage Control</title>
 
 <para>Every format specification consists of a description of the allocation
 of available columns, and the form in which the particular information
@@ -2148,8 +2155,8 @@ proper computer hardware configuration is available.  The use of 72
 columns is always safe, however, and strongly
 recommended. </para></footnote> while a line of print has 120
 available columns.  Any attempt to allocate more than the available
-number of columns will cause an error return (see section
-2.14.1).</para>
+number of columns will cause an error return (see <xref
+linkend='ERROR_RETURN'/>).</para>
 
 <para>(b) The first columnof a card has no special significance.  The first
 (left-most) character of a line of print is treated differently.  This
@@ -2209,12 +2216,13 @@ off-line), and not at all to cards.</para>
 </sect3>
 <sect3><title>The Basic Field Description</title>
 
-<para>Each specification describes successive fields across the available
-columns, starting fromthe left.  If the specification describes fewer
-than the total number of available columns, the line (or card) will
-automatically be filled in with blanks.  But, as indicated above, if
-more than the total number of available columns is included in the
-specification, an error return (see section 2.14.1) will result.</para>
+<para>Each specification describes successive fields across the
+available columns, starting fromthe left.  If the specification
+describes fewer than the total number of available columns, the line
+(or card) will automatically be filled in with blanks.  But, as
+indicated above, if more than the total number of available columns is
+included in the specification, an error return (see <xref
+linkend='ERROR_RETURN'/>) will result.</para>
 
 <para>The basic field description consists of a letter followed by an
 integer.  The letter indicates the form of the information in the
@@ -2331,7 +2339,7 @@ specification is assumed to be in alphabetic (BCD) form both inside
 the computer and outside.</para>
 
 </sect3>
-<sect3><title>Repetition of Basic Field Specifications</title>
+<sect3 id='field_repetition'><title>Repetition of Basic Field Specifications</title>
 
 <para>If several consecutive fields can be described by the same basic
 specification, reptition may be avoided by prefixing the basic
@@ -2400,26 +2408,26 @@ case.</para>
 </sect3>
 <sect3><title>Multiple Specifications</title>
 
-<para>Several specifications may be condensed into one larger one by the use
-of the character "/".  Each appearance of "/" (except as part of a
-Hollerith field-see section 2.15.8) indicates that the specification
-of a new line (or card) is to be started with what follows.  A pair
-"//" causes a blank line (or card), three "///" cause two blank lines
-(or cards), etc.  Thus, the specification</para>
+<para>Several specifications may be condensed into one larger one by
+the use of the character "/".  Each appearance of "/" (except as part
+of a Hollerith field-see <xref linkend='hollerith_fields'/>) indicates
+that the specification of a new line (or card) is to be started with
+what follows.  A pair "//" causes a blank line (or card), three "///"
+cause two blank lines (or cards), etc.  Thus, the specification</para>
 
 <para role='centered'>
 3F10.3/I2, K18, 2C5/7I3*
 </para>
 
-<para>implies that one line (or card) is described by the specification
-3F10.3, and the next line (or card) is described by the specification
-I2,K18,2C5, and the next by 7I3.  It must be noted that each line (if
-printing is being described) is described individually here, and must
-<emphasis> include its own carriage control </emphasis> (see section
-2.15.1).</para>
+<para>implies that one line (or card) is described by the
+specification 3F10.3, and the next line (or card) is described by the
+specification I2,K18,2C5, and the next by 7I3.  It must be noted that
+each line (if printing is being described) is described individually
+here, and must <emphasis> include its own carriage control </emphasis>
+(see <xref linkend='carriage_control'/>).</para>
 
 </sect3>
-<sect3><title>Hollerith fields</title>
+<sect3 id='hollerith_fields'><title>Hollerith fields</title>
 
 <para>Although the C specification is available for transmitting
 characters (Hollerith information) to and from storage, it is often
@@ -2484,19 +2492,19 @@ storage).</para>
 </sect3>
 <sect3><title>Relationship between the List and the Specification</title>
 
-<para>The "list" consists of a set of names of variables to or from which
-information is to flow.  Except for Hollerith strings imbedded in the
-format specification itself (see section 2.15.8) and the S fields,
-each field in the specification refers to one item on the list.  For
-this purpose, a regional entry on the list, such as A(6) ...A(8),
-counts as several names of variables (in this case, the three
-variables A(6), A(7), and A(8).)  During the transmission of
-information, the input or output subroutine scans both the list and
-the specification simultaneously, correlating corresponding entries,
-and associating a field size, a type of conversion, etc. to each
-variable.  If a Hollerith string is encountered in the specification,
-it is immediately transmitted, and it is not associated with any item
-on the "list."</para>
+<para>The "list" consists of a set of names of variables to or from
+which information is to flow.  Except for Hollerith strings imbedded
+in the format specification itself (see <xref
+linkend='hollerith_fields'/>) and the S fields, each field in the
+specification refers to one item on the list.  For this purpose, a
+regional entry on the list, such as A(6) ...A(8), counts as several
+names of variables (in this case, the three variables A(6), A(7), and
+A(8).)  During the transmission of information, the input or output
+subroutine scans both the list and the specification simultaneously,
+correlating corresponding entries, and associating a field size, a
+type of conversion, etc. to each variable.  If a Hollerith string is
+encountered in the specification, it is immediately transmitted, and
+it is not associated with any item on the "list."</para>
 
 <para>For example, if the list consisted of:</para>
 
@@ -2534,7 +2542,7 @@ specification (the *) until it hits a left parenthesis not in an H
 field.  (If there is no left parenthesis, it will move to the
 beginning of the specification).  It then examines the characters just
 to the left of this left parenthesis to see if they are a multiplicity
-indication (see section 2.15.5).  From this left parenthesis (together
+indication (see <xref linkend='field_repetition'/>).  From this left parenthesis (together
 with the multiplicity, if any) to the end of the specification now
 becomes the format specification until the list is satisfied.  A
 similar statement may be made for printed or punched output.</para>
@@ -2620,7 +2628,7 @@ program.  Every card of the remark declaration must have an "R" in
 column 11.</para>
 
 </sect2>
-<sect2><title>Mode Declaration</title>
+<sect2 id='mode_declaration'><title>Mode Declaration</title>
 
 <para>All variables and function values are assumed to have the normal mode
 unless declared otherwise.  Any of the other modes may be specified as
@@ -2649,18 +2657,20 @@ of such mode declarations but a name may not be declared to be of two
 different modes.</para>
 
 <para>All constants are automatically assigned modes by the translator
-(see section 1.1).  Other automatic assignments of modes are:</para>
+(see <xref linkend='constants'/>).  Other automatic assignments of
+modes are:</para>
 
 <orderedlist numeration='loweralpha'>
-<listitem><para>A name appearing in the statement label field is assigned
-statement label mode (see section 1.3).</para></listitem>
+<listitem><para>A name appearing in the statement label field is
+assigned statement label mode (see <xref
+linkend='statement_labels'/>).</para></listitem>
 
 <listitem><para>A function name constant is assigned function name mode (see
-section 1.4).</para></listitem>
+<xref linkend='functions'/>).</para></listitem>
 
 <listitem><para>A vector appearing as the dimension vector of some
-array in a dimension declaration is assigned integer mode (see section
-3.3).</para></listitem>
+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).
@@ -2668,7 +2678,7 @@ assigned a mode consistent with the assigned values (see section 3.7).
 </orderedlist>
 
 </sect2>
-<sect2><title>Dimension Declaration</title>
+<sect2 id='dimension_declaration'><title>Dimension Declaration</title>
 
 <para>Variables may be declared to be array variables, such as vectors or
 matrices of various dimensions, rather than individual variables.</para>
@@ -2712,17 +2722,18 @@ assume during the execution of the program.  The size of the region
 allocated is this number plus one, regardless of whether the program
 actually makes use of this amount or not.</para>
 
-<para>The second argument, given only for arrays with dimension n > 1, is
-the name of the first element in the "dimension vector" for this
+<para>The second argument, given only for arrays with dimension n > 1,
+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 # k+n.  Assuming
+(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>, 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>
+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>
 
 <literallayout>
        D(k) = n
@@ -2770,11 +2781,12 @@ subscripts are not available for vectors.</para>
 
 <para>Dimensioning is automatic in two situations</para>
 
-<para>(a) In case a statement label vector, say L, is used (see section 1.3)
-and n is the highest subscript used on L in the statement label field
-(i.e., if L(m) appears then m # n), then n + 1 locations are reserved
-for L.  L may also appear in a dimension declaration in which case the
-highest linear subscript is used.</para>
+<para>(a) In case a statement label vector, say L, is used (see <xref
+linkend='statement_labels'/>) and n is the highest subscript used on L
+in the statement label field (i.e., if L(m) appears then m &le; n),
+then n + 1 locations are reserved for L.  L may also appear in a
+dimension declaration in which case the highest linear subscript is
+used.</para>
 
 <para>(b) If part of all of a linear array is set by a VECTOR VALUES
 declaration the array need not appear in a dimension statement unless