From: Eric S. Raymond Date: Mon, 28 Jun 2004 02:51:52 +0000 (+0000) Subject: Index up to Function Entry. X-Git-Tag: 1.0~14 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=135c25301809d645d9bee834c4acd32cfa8a599b;p=mad.git Index up to Function Entry. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index c65726d..0464fcd 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -614,7 +614,8 @@ aj; otherwise, go on. -This may be illustrated by following "flow diagram": +This may be illustrated by following "flow diagram": +Flow Diagram @@ -990,7 +991,7 @@ again if |f(x)| ≥ ε. Otherwise, (i.e., |f(x)| < values of a, x and ε to be printed. The arrangement and form of the numbers on the printed page are controlled by the format description which is the value of the vector named -ALPHA. +ALPHA.Format The TRANSFER statement following causes the statement labelled ST to be the next one performed. @@ -1575,7 +1576,7 @@ point before adding. Likewise, in the next step, the integer T2 will be converted to floating point before adding to the floating point number. -Floating Point Subscript +Floating Point Subscripts In other words, although the mode of the expression is floating point because of the presence of the floating point variable Y, some @@ -2195,6 +2196,8 @@ be the output of this function considered as a single valued function. Entry to a function +Function Entry + Entry points to a function being defined are indicated by @@ -2302,6 +2305,8 @@ 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 Restrictions below). +Format + (a) PRINT FORMAT &scriptF;, &scriptL; @@ -2453,6 +2458,8 @@ cancels the previous one. Format Specifications +Format + 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 allocated among the available columns of the card. Similarly, @@ -3392,6 +3399,8 @@ identical in all sections of the program. Function Definitions +Function Definition + There are two main types of functions: The internal @@ -3525,6 +3534,8 @@ ZQ = SIN.(J * Y).P.(M + 1) - Y/XBAR + COS.(J*Z).P.(M-1)-Z/XBAR. Internal and External Functions +Function Definition + Each function definition (except single statement definitions described in ) may define any number of functions and/or any number of procedures. Within one @@ -3541,7 +3552,8 @@ have exactly the same outputs and the same inputs, they would require separate declarations. In the use of a function (i.e., the - call for it) the arguments may be constants, +callFunction +Call for it) the arguments may be constants, variables, or expressions. However, if one of the arguments appears to the left of an "=" sign Equals Sign in a substitution statement in the defining @@ -3579,27 +3591,30 @@ END OF FUNCTION The first statement (INTERNAL FUNCTION (X)) is a function declaration (i.e., declares that the following statements define a function). - + EXTERNAL FUNCTION If this is defining an external function, the declaration would be EXTERNAL FUNCTION (X). Following the words INTERNAL (or EXTERNAL) FUNCTION is the dummy variable list ((X) in this example). The END OF FUNCTION declaration is the last statement in the function definition -program. (In an external function definition -this is also the last statement in the program.) An entry must -provided for each function being defined, but several functions may -share any number of FUNCTION RETURN statements. An entry statement -merely marks a point of entry, and does not effect the sequence of -computation in any way. The expression after the word "RETURN" -indicates that on this return the value of the function is to be the -value of that expression. This expression must agree in mode with the -function whose value it supplies; this agreement is not checked. The -definitions of functions whose calls are intended to be included in -expressions must have an expression following the FUNCTION RETURN -statement. If the calls for a function are to appear in an EXECUTE -STATEMENT (generally such functions have multiple outputs) the +program. (In an external + + + +function definition this is also the last statement in the program.) +An entry must provided for each function being defined, but several +functions may share any number of FUNCTION RETURN statements. An +entry statement merely marks a point of entry, and does not effect the +sequence of computation in any way. The expression after the word +"RETURN" indicates that on this return the value of the function is to +be the value of that expression. This expression must agree in mode +with the function whose value it supplies; this agreement is not +checked. The definitions of functions whose calls are intended to be +included in expressions must have an expression following the FUNCTION +RETURN statement. If the calls for a function are to appear in an +EXECUTE STATEMENT (generally such functions have multiple outputs) the FUNCTION RETURN statement may appear without an accompanying -expression. +expression.Function Call An example of a definition for procedures is as follows: @@ -3657,6 +3672,8 @@ itself (the statements between statement A and statement B), a function name will usually occur with arguments, and an array variable will usually occur with subscripts. +Function Definition + A few comments about the last example. This definition program defines a single-valued function of X, called INVSF.. Since no mode declaration is given it is assumed by the translator that X is @@ -3761,7 +3778,8 @@ They have all been tested on the computer, however, and are correct. The flow chart notation used here varies somewhat from the -illustrations of Chapter 1. The variation is consistent with present +illustrations of Chapter 1.Flow +Diagram The variation is consistent with present computing practice where many individualistic forms are encountered and, moreover, causes no difficulty due to the essentially graphic nature of charts. In particular, iterations are present by the @@ -4104,7 +4122,7 @@ matrix A = (aij). aji. We shall inter­change symmetrically-placed pairs of elements, leaving untouched elements on the main diagonal. The program will be in the form of an external -function. +function.Function Definition Flow diagram: @@ -6113,6 +6131,9 @@ example, if A is a 4 x 3 matrix (m = 4, n = 3) and b = 1, then V(1) = Conditional, SimpleSimple Conditional Dummy VariablesDummy Arguments Error DetectionDiagnostics +FORIteration Statement +FOR VALUES OFIteration Statement +Function ArgumentsArguments of Functions