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=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,14f7200925acb579 X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: No Go To's Forever! Date: 2000/03/22 Message-ID: <8b9da2$ilv$1@nnrp1.deja.com>#1/1 X-Deja-AN: 600679817 References: <38D7B41D.B3494C6A@lmco.com> <38D7B83B.27DC06C8@earthlink.net> <8b93n3$8ai$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x36.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Wed Mar 22 03:05:47 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-03-22T00:00:00+00:00 List-Id: In article , "Ken Garlington" wrote: > "Robert Dewar" wrote in message > news:8b93n3$8ai$1@nnrp1.deja.com... > > > <> > > No, the concern is not for efficiency at all! > > You're the expert, of course, but I'm surprised by this answer. I thought > that structured code in general allowed for easier determination of scope, > making certain optimizations more likely to be applied. Well that is true in some cases, but if gotos are simply used to duplicate more rational control structures, then typical optimizers are not affected. For example, for the two pieces of code here (the original version with a goto, and the replacement version with a loop), most optimizers will produce identical code. I really think that the concern with not using gotos has nothing to do with efficiency. Indeed, it takes a very strong optimizer to recover the efficiency of a goto in some cases. FOr example, consider the two representations of a finite state machine <> .... goto state2; case state1 is .... current_state := state2; it is quite difficult for an optimizer to recover the goto structure from the case statement, and indeed I have not worked with any compiler that manages to eliminate the loop and case statement in the second case. Sent via Deja.com http://www.deja.com/ Before you buy.