Re: RecyclerMM, Goto Label usage

From: Arthur Hoornweg (arthur.hoornweg_at_wanadoo.nl.net)
Date: 06/21/04


Date: Mon, 21 Jun 2004 11:09:25 +0200

Eric Grange wrote:

> It's there for two reasons: to make the compiled code more compact,
> and more importanly, to have only one exit point, one place where
> the cleanup occurs

Then why not use the following, it is "cleaner":

Procedure dosomething;
begin
TRY

...

   place your code here. Any "Exit" will jump to the
   "finally" block rather than exiting the procedure
   and thus perform a nice cleanup.

...

Finally
   cleanup here
end;
end;//proc

-- 
Arthur Hoornweg
(please remove the ".net" from my e-mail address)


Relevant Pages

  • Re: Program termination and array deallocation
    ... Generally STOP means a "graceful" exit. ... user-specified cleanup (unless you use things like the at_exit stuff via ... specifically says that STOP causes a "normal termination"; ... That list of things that happen on normal termination doesn't happen to ...
    (comp.lang.fortran)
  • Re: Rationale behind unwind-protect and double errors
    ... the protected-form preferred? ... Even though cleanup forms in the unwind protect see the same bindings for ... The THROW of B has the inner catch as destination, but that exit point is not ... So the cleanup clause can re-initiate a new control transfer to this same exit ...
    (comp.lang.lisp)
  • Re: Rationale behind unwind-protect and double errors
    ... What do you mean by preference to the protected form? ... You mean what if the cleanup form is being ... executed because of a nonlocal exit in the protected form, ... It makes a lot of sense to abort the original control transfer if a cleanup ...
    (comp.lang.lisp)
  • Re: exit, atexit and scope
    ... cleanupbelow is valid or if something in the norm prevents this ... kind of cross-reference during exit(). ... int *ref; ... At this point cleanup is called. ...
    (comp.lang.c)
  • Re: Bash traps - while emitting ERR trap
    ... >> trap cleanup EXIT ERR ... >> while loop. ...
    (comp.unix.shell)