From: Eric S. Raymond Date: Fri, 20 Feb 2004 06:52:18 +0000 (+0000) Subject: Another two pages. X-Git-Tag: 1.0~56 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=afede6080e8d67f787f4cce417188d054a101970;p=mad.git Another two pages. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index f641a50..e05bc07 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -24,6 +24,7 @@ M"> N"> S"> +V"> ]> Notes from the 21st century @@ -386,6 +387,11 @@ script characters: statement metavariables &scriptS; + +script-V +vector metavariables +&scriptV; + @@ -2989,6 +2995,133 @@ used. declaration the array need not appear in a dimension statement unless the maximum linear subscript implied by the initial values is not sufficiently high. + + +Equivalence Declaration + +This declaration has the form + + +EQUIVALENCE (A,B), (MATRIX, XARRAY), (C, D(3)) + + +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. + +Variables whose names appear within the same set of parentheses need +not have the same mode. The mode must be established by the +appropriate MODE declaration for each of the variables. Occurrences +within an EQUIVALENCE declaration do not establish mode. + +A nonsubscripted array variable name in an EQUIVALENCE statement +represents that element of the array (considered as a one-dimensional +vector) whose subscript is zero. Reference in an EQUIVALENCE +statement to an array element of any number of dimensions may be made +by linear-subscript only (i.e., as an element of a vector). Note that +occurrence of any elements from any two arrays in the same perentheses +implies equating the entire arrays accordingly. + + +ERASABLE Declaration + +This declaration has the form + + +ERASABLE MATRIX, XARRAY, YARRAY + + +and implies that the arrays and individual variables listed after the +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. + + +3.6 PROGRAM COMMON Declaration + +This declaration has the form + + +PROGRAM COMMON MATRIX, X, Y1, BC + + +and implies that the arrays and individual variables listed after the +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). + +One use of this statement provides for several sections or a program +to refer to variables and arrays by the same names, while being +translated and checked out separately. A program divided up this way +would have the form of a main program and several external function +programs, with the main program being used primarily to call on each +of the external functions in turn. Although variables and arrays to +be used jointly by several external functions can be communicated as +arguments to the functions, assigning them to PROGRAM COMMON makes +them available to all sections. + +Note that storage is actually reserved for +PROGRAM COMMON only in the main program (not in external functions, +although the proper address assignment occurs there, also). Any such +declarations occurring in external function definitions must therefore +occur also in the main program. + +Another use for the PROGRAM COMMON assignment is in the case of a +segmented program, i.e., a program so large that it is written in +blocks which will occupy the same section of storage and be brought in +one at a time. If one block of a program is to use the results of the +previous block's computation, the variables involved should be +specified as being in the PROGRAM COMMON region. Then they will not +be destroyed in the process of bringing in the new block of program. +The PROGRAM COMMON and DIMENSION declarations which set up this +storage allocation must be identical in all blocks in which these +arrays and variables are to be used, except that later segments may +add additional names at the end of the list . + +PROGRAM COMMON declarations do not affect variables and arrays which +have already been assigned to this common section of storage. If +another such statement occurs in a program, the arrays and variables +listed therein are considered appended to the previous list of PROGRAM +COMMON arrays and variables. If a program is broken up into a main +program and several external functions, the main program +must be loaded into the computer first if PROGRAM COMMON +is used at all. + + +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: + +(a) VECTOR VALUES &scriptV; = c0, +c1, ... c&scriptL; + +Here &scriptV; is of the form N(n) or simply N, if n = 0. The +elements N(n), ... N(n + &scriptL;) are preset to the values +c0, c1 ..., +c&scriptL;, where the ci +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. + + + @@ -3306,9 +3439,6 @@ function. Flow diagram: -There are two minor errors in this flow diagram, -reproduced faithfully from the original. Can you spot them? -