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: 103376,999932ecc319322a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: advice on package design Date: Fri, 18 Mar 2005 09:31:14 -0000 Organization: BAE SYSTEMS Message-ID: <423a9e2c$1_1@glkas0286.greenlnk.net> 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> X-Trace: individual.net DRXL2F40KIoOKEGgTinL+AKwL4GbF1Hwqfr92ON0H9WzU11/Jn X-Orig-Path: glkas0286.greenlnk.net!glkas0286!not-for-mail X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net Xref: g2news1.google.com comp.lang.ada:9587 Date: 2005-03-18T09:31:14+00:00 List-Id: Marius Amado Alves wrote: > 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.) Thanks - I'm afraid I've already been through the pain of doing just this on several dozen function on my first Ada83 program when I discovered this little 'design feature' :-) Cheers -- Martin