From 9b18f7cf3fc0308bf3cd4ea023e2a93f3c28d6a5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 24 Feb 2004 05:42:02 +0000 Subject: [PATCH] Add another couple of pages. --- doc/mad-manual.xml | 109 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 17183b4..075fd86 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -2952,7 +2952,7 @@ computation) to the values The lower bound of each subscript is assumed to be unity. 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 ≤ J ≤ 8 and 1 ≤ K ≤ 9. The @@ -3058,7 +3058,7 @@ The Retrocomputing Museum implementation does not implement it. -3.6 PROGRAM COMMON Declaration +PROGRAM COMMON Declaration This declaration has the form @@ -3116,7 +3116,7 @@ implement COMMON. Presetting Vectors - + 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: @@ -3132,7 +3132,108 @@ may be any constants. N is automatically set to have the same mode as c0 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 c0. +consistent with the mode of c0. If N appears +in other VECTOR VALUES or DIMENSION declarations the maximum length +given or implied for N is used for storage assignment. The +c1 must all be of the same mode. + +(b) VECTOR VALUES &scriptV; = $ k1 +... km$, +$km+1... kp$, ... + + +Here the ki may be any valid characters +(including blanks but excluding "$") and &scriptL; (used as in (a) above) is +equal to the smallest integer ≥ m/6. + + +This declaration is useful for presetting dimension vectors and and +format descriptions. The presetting is done at the time of +translation. The constants ci 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. + +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 numerical or alphabetical + 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. + + +Function Definitions + +There are two main types of functions: The internal + function and the external 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 +names , instead of values, are used as function arguments. +The problem is considered in more detail in the examples in Chapter +III. + +External Function Definitions + +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. + + +Internal Function Definitions + +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. + +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: + + +INTERNAL FUNCTION SUMSQ.(X,Y,Z) = X * X + Y + Z * Z - T * T + + +As indicated above, X, Y, and Z, as they occur here, are dummy variables, and (X, Y, Z) is the dummy variable list. + -- 2.43.0