Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!clyde!cbatt!cbosgd!ukma!psuvm.bitnet!psuvax1!burdvax!sdcrdcf!ism780c!marty From: marty@ism780c.UUCP (Marty Smith) Newsgroups: net.lang.pascal Subject: Re: Re: Pascal vs C, again (was: Pascals Origins) Message-ID: <2954@ism780c.UUCP> Date: Wed, 23-Jul-86 11:58:30 EDT Article-I.D.: ism780c.2954 Posted: Wed Jul 23 11:58:30 1986 Date-Received: Fri, 25-Jul-86 06:30:01 EDT References: <2943@ism780c.UUCP> <550@cbmvax.cbmvax.cbm.UUCP> Reply-To: marty@ism780c.UUCP (Marty Smith) Organization: Interactive Systems Corp., Santa Monica, CA Lines: 38 In article <550@cbmvax.cbmvax.cbm.UUCP> daveh@cbmvax.cbm.UUCP (Dave Haynie) criticized the following program fragment by quoting form the Pascal bible. >> What's wrong with this one? >> >> label 1,2; >> var i: integer; >> ... >> i :=1 ; >> while i<=1000 do >> if x[i] = 0 then goto 1 >> else i := i+1; >> >> writeln('not found'); >> goto 2; >> 1: writeln('zero at location', i ) >> 2: ... >> >> Martin Smith > >"...avoid the use of jumps to express regular iterations and conditional >execution of statements, for such jumps destroy the reflection of the >structure of computation in the textual (static) structure of the program." > > Pascal User Manual and Report, p. 32 But, Dave, the above quote is not part of the language definition; labels and gotos are. The original posting complained that x[i] was evaluated twice. This example avoids that problem with no loss of clarity, in my opinion. If you want to take my gotos from me, you'll have to pry them from my cold, dead hands (or make me use Modula 2). Martin Smith ps. Note that a C break statement is nothing more than a goto without specifying the label. Surely you must agree that a goto without a label makes for more difficult understanding than a goto with a label. If you won't allow my use of labels in Pascal, then you must also disallow the use of break in C.