[comp.lang.misc] "continue" in Turing

marc@hpfcdc.HP.COM (Marc 'Sphere' Sabatella) (01/31/89)

/ hpfcdc:comp.lang.misc / migod@csri.toronto.edu (Mike Godfrey) / 10:22 pm  Jan 27, 1989 /
In article <5200038@m.cs.uiuc.edu> wsmith@m.cs.uiuc.edu writes:
>>
>>Now my question, in this framework, is there a Turing equivalent to the C:
>>
>>		if (condition3) continue;
>>
>>If not, it is a serious omission.
>
>Hmm, I can only guess that you mean "Does Turing have some sort of do-nothing 
>statement?" As it turns out, the answer is yes and it looks like this:
>
>Get it?  The null statement is a part of Turing.

No, that is not the same thing:

while (c)
{
	A;
	if (condition3)
		continue;
	B;
}

The "continue" is not a "null statement" in C as it is in Fortran.
I don't know if this is easily modelled in Turing or not.

This is the same objection I have to the otherwise clever idea having a
unified "struct ... tcurts" statement which handled basic block statements,
if-then, if-then-else, and loops with a single syntax.  It couldn't handle
"break" or "continue" that occurred within an "if" within a loop.  I thought
it was otherwise a wonderfully elegant idea.

--------------
Marc Sabatella
HP Colorado Language Lab
marc%hpfcrt@hplabs.hp.com

migod@csri.toronto.edu (Mike Godfrey) (01/31/89)

    Someone wrote:
    >>> Does Turing have an analogue of "continue" (as in C)?


    I wrote:
    >> Hmm, I can only guess that you mean "Does Turing have some sort of 
    >> do-nothing statement?"


    Then marc@hpfcdc.HP.COM (Marc 'Sphere' Sabatella) wrote:
    >
    >No, that is not the same thing:


*sigh*  I was afraid of this.

Yes, I'm afraid that I had my Fortran thinking cap on when I posted this.  
A friend pointed this out to me and I cancelled the article.  Apparently my 
faith in the cancel command (I was about to say "C" there, but I realized in 
the nick of time that this might start yet another misunderstanding :-) was 
unjustified.

As to the original question ("Does Turing have a analogue of C's `continue'"?)
the answer is no.  Turing does not have such a bird (although I am told that
Numerical Turing does).  This is not believed to be a short-coming of the 
language.

-- 

Mike Godfrey				 "You say `Car-meen-a'
Department of Computer Science	          And I say `Car-mine-a'
University of Toronto			  Let's call the whole thing Orff."
migod@csri.toronto.edu