From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,19b6efa2ecebaed0 X-Google-Attributes: gid103376,public From: "Tom Phinney" Subject: Re: Ada95 Pretty-Printers Date: 1997/06/14 Message-ID: <01bc7874$c9e9e660$aae32581@anonymous>#1/1 X-Deja-AN: 248276291 References: <339C58A6.4D5A@sprintmail.com> <339D677D.2FAC886C@link.com> <33A02793.431C@sprintmail.com> <33A157AA.1F2F3650@link.com> Newsgroups: comp.lang.ada Date: 1997-06-14T00:00:00+00:00 List-Id: Samuel Mize wrote in article <33A157AA.1F2F3650@link.com>... > John G. Volan (quoting himself) wrote that Apex does this: > All this is in accordance with the indentation shown in the ARM, but I > personally just hate it. I don't think a loop or block should be indented > just because it's named. I feel that the "when" clauses are a parallel > part of the structure. It makes no more sense to indent "when" or "then" > than it does to indent "else." Obviously, this is all just personal > opinion. But I'm glad to see a smart guy and a significant company > agreeing with me :-) . ------- The whole point in the "comb" structure was (1) to have a structure with bounds on both ends -- the lesson learned from the unclosed Pascal constructs like "if" (without an "end if"); (2) to have a series of "tines" between the ends of the comb to separate the intermediate portions of the construct. What's the point of putting a second level of indentation on the inner part of the comb relative to the comb ends? Why should some tines in some combs be indented, and others not? My personal practice is to put the "tine" keywords either as the last or first lexeme(s) of each line, with the choice made for readability. This leads (with blank lines omitted when the constructs are parallel and visually small) to if then elsif then else end if; when the boolean expression is small enough to fit on a single line, but any one of the if or elsif clauses could change to a multi-line form when the expression itself requires multiple lines, as in if then elsif then else end if; A similar approach applies to loop, case, and the other "comb" structures. In fact, I frequently use the same syntax for procedure, etc. definitions, with the "is" moving to an isolated line when that provides better readability and a more intelligible comb structure. This same approach works for VHDL (no surprise :-), and has been used in a number of projects where readability was a major issue. Tom Phinney Honeywell