Re: GoTo in Java
- From: "Chuck Stevens" <charles.stevens@xxxxxxxxxx>
- Date: Wed, 18 Jan 2006 09:52:33 -0800
"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:p0sss1p31ovm46qj1mkt43erl1etal90jk@xxxxxxxxxx
>
> The use of exit paragraphs (which I thought I was through with) is a
> partial solution. To pick the correct level of exits, I would need
> switches.
>
> A better solution would be a labeled EXIT PERFORM statement.
First off, EXIT PERFORM is usable only with an "inline" PERFORM. J4
discussed the idea of extending it to out-of-line PERFORMs in the 2008 draft
and rejected the idea as too risky amd too much like GO TO.
But let's presume the standard did allow an EXIT PERFORM outside the context
of PERFORM ... END-PERFORM (our COBOL74 compiler, lacking inline PERFORMs,
has exactly this capability).
Because PERFORM ... THRU is still valid COBOL, the syntax for a "labelled
EXIT PERFORM" would have to allow the specification of both the start and
the end of the PERFORM range. That's starting to look really clumsy. And
beyond that, implementors would need to provide a mechanism to maintain some
encoded identification of both the start and end points of every active
PERFORM so that the specified range could be checked against EXIT PERFORMs
encountered at execution time.
If a labelled EXIT PERFORM statement were executed, and the end-points
specified don't match any of the PERFORMs that are currently "active", what
is the appropriate result? Other EXITs are treated as CONTINUE if they
appear "out of context", but that leads to a nightmarish risk of unexpected
results at execution time.
Personally, I think labelled EXIT PERFORM would raise more problems than it
would solve. Even EXIT PERFORM <integer>, where <integer> is the number of
levels to "exit", might be easier to define and less prone to errors , but
I'd be *really* surprised if very many people on this forum thought that
would be a fundamental improvement to COBOL's syntax!
-Chuck Stevens
.
- Follow-Ups:
- Re: GoTo in Java
- From: Michael Wojcik
- Re: GoTo in Java
- References:
- GoTo in Java
- From: Howard Brazee
- Re: GoTo in Java
- From: Peter Lacey
- Re: GoTo in Java
- From: Howard Brazee
- Re: GoTo in Java
- From: Tiberiu Gociu
- Re: GoTo in Java
- From: Howard Brazee
- GoTo in Java
- Prev by Date: Re: GoTo in Java
- Next by Date: Re: GoTo in Java
- Previous by thread: Re: GoTo in Java
- Next by thread: Re: GoTo in Java
- Index(es):