Path: utzoo!yunexus!spectrix!John_M From: John_M@spectrix.UUCP (John Macdonald) Newsgroups: comp.lang.misc Subject: Re: Loops Message-ID: <564@spectrix.UUCP> Date: 19 Apr 88 00:09:40 GMT Article-I.D.: spectrix.564 Posted: Mon Apr 18 20:09:40 1988 References: <3041@enea.se> <885@cresswell.quintus.UUCP> Reply-To: jmm@spectrix.UUCP (John Macdonald) Organization: Spectrix Microsystems Inc., Toronto, Ontario, Canada Lines: 40 In article <885@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: :In article <3041@enea.se>, sommar@enea.se (Erland Sommarskog) writes: :: Dr A. N. Walker (anw@nott-cs.UUCP) writes: :: >Joe Keane (jk3k+@andrew.cmu.edu) writes: :: >>While i'm at childish flaming, i might as well say that i _really_ hate :: >>`fi', `rof', `esac', and `elihw'. Can anyone say they're a good idea and :: >>keep a straight face? :: > Yes. "They're a good idea." :-| :[I can say that too. "]" goes with "[", so why _not_ "fi" with "fi"?] :: Ada has "end if", "end loop", "end case" and "end ". Note also :: that "end if" (or "fi" or whatever") helps you little when :: you have many nested if-statements. You're just as bad out as with :: only "end", unless you add a comments like: :: end if; -- test A :: end if; -- test B : :SETL used to end everything with 'end', but you could supply some number of :tokens after it, and the compiler would check that they exactly matched the :beginning. E.g. : if i < j ..... end [if [i [< [j ...]]]] :I forget what the limit was, something like 3 tokens. My personal preference is for a technique used in SWL. It was more or less an extension of Pascal. All blocks were terminated with a unique terminator easily derived from the initiating token - add 'end' to the token, eliding double 'e's. Thus, while ... whilend, if ... ifend, repeat ... repeatend, proc ... procend, etc. (Just to prove that rules are meant to be broken, there was still the familiar begin ... end. Oh well.) I find this approach to be the easiest to quickly find the other bound of a unit, but I'm sure that other people have different preferences. SWL (Software Writers Language, pronounced swill, lots of Wizard of Id spook cartoons on the walls, bug reports featured the "there's a fly in my swill" cartoon) was developed jointly by CDC and NCR for their internal systems development use, including a joint computer line. It is still around. Within CDC, it has been renamed CYBIL (CYBer Implementation Language). Within NCR, I believe it also changed its name. -- John Macdonald UUCP: {mnetor,utzoo} !spectrix!jmm