Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Languages with GOTO

Name: suomynonA 2007-07-17 12:49 ID:sJhm9IHJ

Is there a modern programming language which has GOTO function in it? I know basic from a millenia ago and recently learned java, and well I hated OOP, but I could live with it if I had goto.

Name: Anonymous 2007-07-20 2:28 ID:TGq5iOhg

>>36
Taken from: http://cpptips.hyperformix.com/cpptips/sometimes_goto.txt


TITLE: a concise example using "goto"

(Source: Private mailing from David on Mon Oct  6 11:24:58 1997)


TRIBBLE: David R. Tribble (tribble@central.beasys.com">david.tribble@central.beasys.com)

Sometimes using goto statements is the most concise and understandable
form for certain programming constructs.

For example:

    void parse()
    {
        Token* tok;

    read:
        tok = getToken();       // 1
    shift:
        if(shiftTok(tok))      // 2
            goto read;
        if(reduceTok(tok))     // 3
            goto shift;
    }

The three statements above form two tight intertwined loops.  It's left as an excercise for the reader to rewrite the loops without using gotos. But you'll find that the way it's written above is the most concise and clearest.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List