From: Eric S. Raymond Date: Fri, 13 Feb 2004 22:29:26 +0000 (+0000) Subject: Add some more on differences. X-Git-Tag: 1.0~110 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=08768f5dceab0a2c0f944c43961a38d26d852fc5;p=mad.git Add some more on differences. --- diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 743e591..147c5fc 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -2,7 +2,6 @@ @@ -98,10 +97,10 @@ reasin that flowcharts were getting too large to draw and read! There are some significant respects in which MAD was actually rather advanced for its period. The multiline WHENEVER statement -anticipated the free-format syntax of ALGOL 60 and its descendants, -including Pascal and C. The DEFINE statement, which supports -syntactic extension of the language, was an interesting experiment -not emulated in most later designs. +anticipated the free-format syntax of ALGOL 60's descendants, +including Pascal and C. The DEFINE statement, which supports +syntactic extension of the language, was an interesting experiment not +emulated in most later designs. In most of the respects we've described, however, MAD is very typical of its time. This will become apparent from a look at the @@ -130,12 +129,32 @@ overflow of numeric results may therefore differ. The original MAD limit of 6 characters on variable names, labels, and string constants is not enforced. +Character READ FORMATs into arrays cause their equivalents in the +generated C code to be declared with a base char type as would +be usual in C. Perfect fidelity to the MAD code would have required +the data to be unpacked into int or double arrays, but that code +would have been far more complicated to generate and hard to read. + +In original MAD all variables were global, and arguments were +passed by reference. In the interests of generating reasonably clean +C, this implementation makes variables local to the functions in which +they occur and passes arguments by value. Exploiting the original MAD +behaviors was considered bad style even then, and none of the examples +given in the manual rely on them. + Label arrays, array-mode variables, and the associated computed-transfer statement are not implemented. Neither are ERROR RETURN, multiple ENTRY points, or TAPE and DRUM statements. -All external function definitions must precede -the program main line. +On the other hand, some limits in original MAD are not present +in this implementation, mainly because it would have required actual +effort to enforce them. Names and string constants may be longer than +6 characters, and may contain underscores and lowercase +letters. Source lines are not limited to 72 chars long. + +All external function definitions must precede the program main +line. It is unclear whether or not this was true in original +MAD. The generated C is self-contained and does not require any dedicated runtime support, except that the stdio and math libraries @@ -520,7 +539,12 @@ reading Chapter II. such as the loop, etc. The input form of our example would be: -&min; + DIMENSION A(100) + Z = A (0) + THROUGH BACK, FOR J = 1, 1, J .G. N +BACK WHENEVER Z .L. A(J), Z = A(J) + INTEGER J, N + END OF PROGRAM The DIMENSION statement assigns a block of storage in the @@ -1516,7 +1540,7 @@ CONTINUE to be performed by its presence or absence. -THROUGH (Iteration) Statement +THROUGH (Iteration) Statement The following program segment illustrates the use of this statement. @@ -1693,8 +1717,8 @@ In the original, the phrase ", indicated by ... below" was not present. Instead, a large open-brace at the left of the diagram pointed at the word "scope", indicating the body section filled with ellipses. --> -As indicated in section 2.5, the "scope" of an iteration -statement is the block of statements designated for repeated +As indicated in , the "scope" of an +iteration statement is the block of statements designated for repeated execution, indicated by ... below: