From: Eric S. Raymond Date: Tue, 29 Jun 2004 05:25:56 +0000 (+0000) Subject: Index up to "Scope". X-Git-Tag: 1.0~7 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=eaabc991b44bfa604dff0acf7bc9b03e8dfd38ab;p=mad.git Index up to "Scope". --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 330bfeb..e2f69ba 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -787,15 +787,17 @@ modification and counting. The reason for this is that integer arithmetic can be done more simply and efficiently, usually with less round-off error, than arithmetic on non-integers. [Numbers which may have fractional parts are usually written in the so-called "scientific -notation", such as 3.1 × 10-6 are -called floating point numbers.] Constants, -Floating Point Numbers are assumed to be in the -floating-point mode unless otherwise declared, as in the INTEGER -statement in the example. INTEGER -Statement The WHENEVER statement above is to be -interpreted in the sense: Whenever the following condition (in this -case Z < aj) is satisfied, do the specified -action (Z = aj), otherwise just go on. +notation", Scientific +Notation such as 3.1 × +10-6 are called floating point numbers.] +Constants, Floating Point +Numbers are assumed to be in the floating-point mode unless otherwise +declared, as in the INTEGER statement in the example. +INTEGER Statement The +WHENEVER statement above is to be interpreted in the sense: Whenever +the following condition (in this case Z < +aj) is satisfied, do the specified action (Z = +aj), otherwise just go on. Floating Point @@ -1935,7 +1937,8 @@ label of the last executable statement in the block to be repeated. The block of statements following (and not including) the THROUGH statement, up to and including the statement whose label is &scriptS;, will be called the "scope" of the THROUGH -statement. Following the word OF appears the name of the iteration +statement. Scope +Following the word OF appears the name of the iteration variable (in the illustration: V), which may be either an individual variable or @@ -2103,6 +2106,7 @@ themselves, be iteration statements. However, if iteration statement a, then the scope of b must be entirely within the scope of a. The following diagrams represent some valid configurations: +Scope &scope1; @@ -2319,6 +2323,9 @@ the currently designated temporary storage vector. RESTORE DATA &scriptL; +RESTORE DATA Statement +RESTORE RETURN + &scriptL; is a list of single or subscripted variable names or array segments of the type described in (b). If the list designates n names (not necessarily n items in the list) the values of the last n @@ -2444,7 +2451,9 @@ address &scriptA; (where &scriptA; is an integer expression). (h) REWIND TAPE &scriptN; -Rewinds tape &scriptN;. +Rewinds tape &scriptN;. +REWIND TAPE Statement + @@ -2855,6 +2864,8 @@ fields. A "scale factor" may be applied to an F number Printed number = Internal number x 10Scale factor +Scale Factor (Format) + (where the scaling is accomplished before the conversion is done). The "scale factor", followed by the letter "P"P Prefix (Format) is @@ -3118,6 +3129,8 @@ other statements. Remark Declaration +Remark Declaration + A remark declaration consists of any string of characters acceptable to the computer. This statement is completely ignored by the translator, and furnishes information to the reader of the @@ -3896,6 +3909,8 @@ A(i1,...,in). EXAMPLES +Scientidic Examples + Note:The following illustrates how some programs may be writtten in the MAD language. Since they were written to illustrate as many features of the language as possible, they are not necessarily the @@ -3919,6 +3934,8 @@ form: Iteration Statement +Scope + Here the scope of the iteration lies between the hexagonal box and diamond box A, and the calculation proceeds from A when the stated relation is true. @@ -4419,6 +4436,9 @@ only as an example problem. The Program: +SAVE DATA +SAVE RETURN + &jordan; @@ -4910,8 +4930,6 @@ character per word in W(1)...W(L). <emphasis role='note'>Example 2: Compute the factorial function</emphasis> Problem: Evaluate the recursive function, - -List Manipulation f(0) = 1 f(n) = f(n-1) * n @@ -4928,6 +4946,13 @@ using a THROUGH statement, instead the function will illustrate how recursive functions can be handled. + +List Manipulation +RESTORE DATA Statement +RESTORE RETURN +SAVE DATA +SAVE RETURN + &factfunc; @@ -5139,7 +5164,8 @@ MAD. Subroutines which are written for use by MAD programsⅆwhether written in MAD as functions or in SAPSAP is the SHARE Assembly Program which permits the writing of actual machine -instructions in symbolic form.ⅆmust be relocatable +instructions in symbolic form. +SAP ⅆmust be relocatable Relocatable Binary Programs and must operate from the calling sequences the translator produces. Consider, for example the function call - FN. (A,B,C) - which might