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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,23ffa52608fbb144 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.152.217 with SMTP id h25mr1897547bkw.3.1337459621328; Sat, 19 May 2012 13:33:41 -0700 (PDT) Path: e27ni19134bkw.0!nntp.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.bbs-scene.org!xmission!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Problem with Delay Alternative in Finalization Date: Sat, 19 May 2012 16:31:59 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <6v0er7d545kvs3pr7aqe1dnrlq4mg5ldhg@4ax.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1337459519 27485 192.74.137.71 (19 May 2012 20:31:59 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 19 May 2012 20:31:59 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:YgVadpbDkJh1CUp0At4rvt52AsU= X-Received-Bytes: 2126 Content-Type: text/plain; charset=us-ascii Date: 2012-05-19T16:31:59-04:00 List-Id: Tim McGuire writes: > Procedure Token_Test is > begin > declare > Token : Test_Lock_Token.Lock_Token; > begin > Ada.Text_Io.Put_Line ("Got Token"); > declare > Token_2 : Test_Lock_Token.Lock_Token; > begin > Ada.Text_Io.Put_Line ("Got Token_2"); > exception > When Errors : Test_Lock_Token.Lock_Timeout_Exception => > Ada.Text_Io.Put_Line ("Token_2 timed out!"); > end; > exception > When Errors : Test_Lock_Token.Lock_Timeout_Exception => > Ada.Text_Io.Put_Line("Token timed out!"); > end; > end Token_Test Your code is full of syntax errors, so obviously this isn't the code you ran. But anyway, I think your exception handlers are confused. An exception handler in a block does not handle exceptions raise in the "declare" part of the same block. Ada's syntax is confusing in that regard -- it LOOKS like they are handled. This is something Java (for example) gets right. Exception handlers shouldn't be syntactically part of blocks, procedure bodies, etc -- they should have a separate statement. - Bob