From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.83.11 with SMTP id n11mr5477861itb.48.1515290723988; Sat, 06 Jan 2018 18:05:23 -0800 (PST) X-Received: by 10.157.45.110 with SMTP id v101mr146834ota.13.1515290723727; Sat, 06 Jan 2018 18:05:23 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!usenet-its.stanford.edu!usenet.stanford.edu!i6no1043627itb.0!news-out.google.com!s63ni1346itb.0!nntp.google.com!i6no1043624itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 6 Jan 2018 18:05:23 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:193:4101:1b33:4953:875e:1e00:eca8; posting-account=1tLBmgoAAAAfy5sC3GUezzrpVNronPA- NNTP-Posting-Host: 2601:193:4101:1b33:4953:875e:1e00:eca8 References: <7b8a1da2-c405-4cbc-9c0b-1fef804c9239@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: stopping a loop iteration without exiting it From: Matt Borchers Injection-Date: Sun, 07 Jan 2018 02:05:23 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:49797 Date: 2018-01-06T18:05:23-08:00 List-Id: On Saturday, January 6, 2018 at 5:04:08 PM UTC-5, J-P. Rosen wrote: > Le 06/01/2018 =C3=A0 01:26, Matt Borchers a =C3=A9crit=C2=A0: > > begin > > ... > > exception > > when EX1 =3D> ... > > when EX2 =3D> ... > > when others =3D> ... > > finally > > ... > > end; > >=20 > > This would allow programmers to handle common cleanup operations that w= ould otherwise have to be duplicated in every exception case. > Actually, it is possible (ever since Ada 83!) to have a common part for > all exception handlers, and then different handlings according to the > exception: >=20 > exception > when others =3D> > begin > Common_Part; > raise; > exception > when EX1 =3D> ... > when EX2 =3D> ... > ... > end; > end >=20 > --=20 > J-P. Rosen > Adalog > 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX > Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 > http://www.adalog.fr Interesting, but to get the common part to execute AFTER the exception hand= ling looks very strange and begs for a better solution that to re-raise the= exception in the first line of the exception handler. exception when others =3D> begin raise; exception when EX1 =3D> ... when EX2 =3D> ... ... end; Common_Part; end;