]> thyrsus.com Git - mad.git/commitdiff
Add another couple of pages.
authorEric S. Raymond <esr@thyrsus,com>
Tue, 24 Feb 2004 05:42:02 +0000 (05:42 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Tue, 24 Feb 2004 05:42:02 +0000 (05:42 +0000)
doc/mad-manual.xml

index 17183b4e44386039244e1479cfdca0f6e5a17f7b..075fd866886b33dd57841be85ce8b643f3052e62 100644 (file)
@@ -2952,7 +2952,7 @@ computation) to the values</para>
 <para>The lower bound of each subscript is assumed to be unity.</para>
 
 <para>Thus, in the statement: DIMENSION XA(400, V), YT(300, K(3)) where V(0)
-=2,V(1) =6, v(2) =13, K(3) =3, K(4) =4, K(5) =8, and K(6) =9, the
+= 2,V(1) = 6, v(2) = 13, K(3) = 3, K(4) = 4, K(5) = 8, and K(6) = 9, the
 variables XA and YT are designated as 2-dimensional and 3-dimensional
 arrays respectively.  Considering the array element XA(I,J), the range
 of J may be expressed by 1 &le; J &le; 8 and 1 &le; K &le; 9.  The
@@ -3058,7 +3058,7 @@ The Retrocomputing Museum implementation does not implement
 it.</para></note>
 
 </sect2>
-<sect2><title>3.6  PROGRAM COMMON Declaration</title>
+<sect2><title>PROGRAM COMMON Declaration</title>
 
 <para>This declaration has the form</para>
 
@@ -3116,7 +3116,7 @@ implement COMMON.</para></note>
 </sect2>
 <sect2><title>Presetting Vectors</title>
 
-<!-- The script L in this section is lowercase -->
+<!-- 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
 vector, i.e., using linear subscripts) may be preset by a declaration
 of the following form:</para>
@@ -3132,7 +3132,108 @@ may be any constants.  N is automatically set to have the same mode as
 c<subscript>0</subscript> and given a storage reservation of n +
 &scriptL; + 1 locations, i.e., this is equivalent to writing DIMENSION
 N(N + &scriptL;).  N may appear in a mode declaration provided it is
-consistent with the mode of c<subscript>0</subscript>.</para>
+consistent with the mode of c<subscript>0</subscript>.  If N appears
+in other VECTOR VALUES or DIMENSION declarations the maximum length
+given or implied for N is used for storage assignment.  The
+c<subscript>1</subscript> must all be of the same mode.</para>
+
+<para>(b) VECTOR VALUES &scriptV; = $ k<subscript>1</subscript>
+... k<subscript>m$</subscript>,
+$k<subscript>m</subscript>+1... k<subscript>p$</subscript>, ...</para>
+
+<!-- the m/6 here is $m over 6$ in eqn notation -->
+<para>Here the k<subscript>i</subscript> may be any valid characters
+(including blanks but excluding "$") and &scriptL; (used as in (a) above) is
+equal to the smallest integer &ge; m/6.</para>
+
+<!-- the original had a typo in the first sentence, duplicated "and" --> 
+<para>This declaration is useful for presetting dimension vectors and and
+format descriptions.  The presetting is done at the time of
+translation.  The constants c<subscript>i</subscript> are loaded (as
+part of the translated program) into &scriptV;.  This declaration
+produces no computation at execution time.  However, the values of
+&scriptV; may be modified by other statements in the program during
+execution.</para>
+
+<para>Vectors which have been assigned to ERASABLE storage (see seciton 3.5)
+may not be preset by a VECTOR VALUES statement.  Vectors which have
+been assigned to the PROGRAM COMMON section of storage (see section
+3.6) can be preset with <emphasis>numerical or alphabetical
+</emphasis> information only (not statement labels or function names)
+and then only if it is a single section program (i.e., storage is
+loaded with instructions only once) or, if it is a multiple section
+program, the PROGRAM COMMON region is identical in all sections of the
+program.</para>
+
+</sect2>
+<sect2><title>Function Definitions</title>
+
+<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
+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>
+
+<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
+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>
+
+</sect3>
+<sect3><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
+dimensioned.</para>
+
+<para>One form of internal function definition (not available as an external
+function definition because the latter must be a complete, independent
+program) is the one sentence definition, which has the form:</para>
+
+<para role='centered'>
+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>
+</sect3>
 
 <!-- MORE GOES HERE -->