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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,86c750b8474bf6d5 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.velia.net!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: About String Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <484ABED3.8040909@obry.net> <484b802a$0$23844$4f793bc4@news.tdc.fi> Date: Sun, 8 Jun 2008 09:35:31 +0200 Message-ID: NNTP-Posting-Date: 08 Jun 2008 09:35:32 CEST NNTP-Posting-Host: 0f4052fe.newsspool1.arcor-online.net X-Trace: DXC=W@J_d@Wn>T:L2C_`koXfC5ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2bjgW5j\LYK7[6LHn;2LCV>[ On Sun, 08 Jun 2008 09:47:30 +0300, Niklas Holsti wrote: > The solution is just to add one more "begin..end" block, enclosing > the "declare .. begin .. end", and handle the exceptions in this > outer "begin..end" block. Or handle the exceptions in the > subprogram's "begin..end" block and nest the "declare..begin..end" > within the subprograms "begin..end". > > That said, I admit that I, too, have made this mistake once or > twice. But not lately. If exceptions were contracted such, quite nasty, errors could be detected at compile time. > I wonder if it would be a good idea for Ada to allow an exception > handler also in the "declare" part, as follows: > > -- NOT Ada! > declare > exception > begin > exception > end; > > Of course, in this proposal the declaration-exception handler would > not have access to the declared variables. But then, for regularity sake, you would need to add exception handling to all declarative parts: package A is exception (:-)) end A; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de