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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,999932ecc319322a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!fr.ip.ndsoftware.net!proxad.net!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Marius Amado Alves Newsgroups: comp.lang.ada Subject: Re: advice on package design Date: Thu, 17 Mar 2005 21:14:30 +0000 Organization: Cuivre, Argent, Or Message-ID: References: <1110212638.336123.298580@l41g2000cwc.googlegroups.com> <1gbk0qx2sgzpg$.sltzfssofla8$.dlg@40tude.net> <3jok3ghqqls8$.1rrsonb8jsurt$.dlg@40tude.net> <88zllqj1min5$.fqqxis9i327d$.dlg@40tude.net> <18e9a92kz25wu$.8b965bel5vef$.dlg@40tude.net> <1dgodaruwhhwo$.1baazg490isjx.dlg@40tude.net> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1111094093 4339 212.85.156.195 (17 Mar 2005 21:14:53 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 17 Mar 2005 21:14:53 +0000 (UTC) Cc: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: X-Mailer: Apple Mail (2.619.2) X-OriginalArrivalTime: 17 Mar 2005 21:14:31.0212 (UTC) FILETIME=[4F82AEC0:01C52B36] X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:9565 Date: 2005-03-17T21:14:30+00:00 >> with Ada.Text_IO; use Ada.Text_IO; >> procedure Main is >> function Foo (I : Integer) return Integer is >> I2 : Integer := I + 1; >> begin >> return I2; >> exception >> when others => >> return 0; >> end Foo; ... >> exception >> when others => >> Put_Line ("Rats... why not catch it in 'Foo'?"); >> Bob told you why. I'll tell you how, just in case. Rewrite Foo thus: function Foo (I : Integer) return Integer is begin declare I2 : Integer := I + 1; begin return I2; end; exception when others => return 0; end Foo; (Of course this how follows from the why. I2 is no longer visible in the handler.)