Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site tikal.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!hplabs!tektronix!uw-beaver!tikal!bobc From: bobc@tikal.UUCP (Bob Campbell) Newsgroups: net.lang Subject: Re: and if you put this in your language ... Message-ID: <367@tikal.UUCP> Date: Tue, 11-Mar-86 01:28:17 EST Article-I.D.: tikal.367 Posted: Tue Mar 11 01:28:17 1986 Date-Received: Fri, 14-Mar-86 04:39:39 EST References: <1187@mmintl.UUCP> Reply-To: bobc@tikal.UUCP (Bob Campbell) Organization: Teltone Corp., Kirkland, WA Lines: 48 Keywords: Keep it simple..... Summary: Why? In article <1187@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes: >There is a fairly common, relatively simple programming structure which >cannot be easily coded using standard control statements (not gotos) in >any language I know of. In flow-chart form, the control structure is as >follows: I must beg to differ your flow-chart can be easily converted to a less complex diagram (uses only two of the three basic units) as follows. (Yours is on the Left :-) | | A:/\ A:/\ +---\/---+ +---\/---+ +-+ | +-+ | |X| | |X| | +-+ | +-+ | | | | | B:/\ | B:/\ | +--\/-------+ +--\/--+ | +-+ +-+ +-+ +-+ +-+ |Y| |Z| |Y| |Z| |Z| +-+ +-+ +-+ +-+ +-+ +-----+-----+ +--+---+ + | | | | +---+----+ | My referance for this piece of work is "The Programming Language Landscape" by H. Ledgard and M. Marcotty. (A rather interesting look at programming language constructs). Any way the book refers to the "Fundamental Control Structure Theorem" and credits Boehm and Jacopini [Communications of the ACM, 1966] with the theorem, and Mills [IBM Corporation Report FSC 71-6012, 1972] with the formal proof. It basicly shows that this and the other example you had of the "orif" can also be transformed in a simular fashion. One premise for the use of control structures is that it keeps the flow of control clear, therefore reducing the chance of overlooking something. It is my opinion that the "andif" and "orif" will add unneeded confusion. Oh by the was don't bother to tell me that Z appears twice, I know that it does, and in most cases the amount of code space wasted is not worth saving (and in those cases where the code space is needed use a GOTO). Bob Campbell Teltone Corp. {amc,dataio,fluke,uw-beaver}!tikal!bobc