[top] [prev] [next]

Exit

The statement

    EXIT
raises the exit-exception. An EXIT statement must be textually enclosed by a LOOP, WHILE, REPEAT, or FOR statement.

We define EXIT and RETURN in terms of exceptions in order to specify their interaction with the exception handling statements. As a pathological example, consider the following code, which is an elaborate infinite loop:

    LOOP
      TRY
        TRY EXIT FINALLY RAISE E END
      EXCEPT
        E => (*skip*)
      END
    END

[top] [prev] [next]


[Modula-3 home page]

m3-request@src.dec.com
Last modified on Wed Apr  3 09:39:07 PST 1996 by heydon
     modified on Fri Apr 15 08:53:02 PDT 1994 by kalsow