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, 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/04/17 Message-ID: <8df3a7$j2g$1@nnrp1.deja.com>#1/1 X-Deja-AN: 612215745 References: <8bdbof$t19$1@nnrp1.deja.com> <8berdq$j2p$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x32.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Apr 17 13:24:36 2000 GMT X-MyDeja-Info: XMYDJUIDrobert_dewar Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) Date: 2000-04-17T00:00:00+00:00 List-Id: In article , ka@exit109.com (Kenneth Almquist) wrote: > Robert Dewar wrote: > > But there really is a very fundamental point here. If you want > > to study it further, try generating the full denotational > > semantics and in fact try generating the full proof conditions. > > That will make things clearer I think. Incidentally, one more point, to construct the denotational semantics of the original formulation with the goto is not quite trivial. Obviously you don't want to describe the goto as a general goto (the denotational semantics of general gotos are gruesome, see the original Ada/Ed implementation for some indication of what I mean). This goto is really a special kind of loop construct, and indeed in a language with a bit more general control over loops (e.g. SETL) you would not use a goto at all for the outer loop, since it can be formulated more clearly. Basically the goto here is a "repeat loop q" construct, and that has a fairly simple denotational semantics. Indeed in this particular case, you can of course get rid of the goto by replacing it with a simple tail recursion, and the denotational semantics should reflect such a replacement. I sometimes wonder if people who have a hard time with gotos in general also have a hard time with recursion. For me, the goto that replaces a tail recursive call is a very special case, and I regard it as simply a minor syntactic variation on the tail recursive call (a good compiler will convert such a tail recursion to the goto in any case). Yes, general gotos can be a horrible mess, but the special case used here of a goto that simply reflects a normal tail recursive structure seems quite straightforward to me, and I see no more reason for forbidding it than I would see for forbidding tail recursion :-) Sent via Deja.com http://www.deja.com/ Before you buy.