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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d8a4797a79f9c90f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-27 12:21:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!news-FFM2.ecrc.net!news.cesnet.cz!crax.cesnet.cz!news.felk.cvut.cz!not-for-mail From: "Sergey Koshcheyev" Newsgroups: comp.lang.ada Subject: Re: I/O - exception handling Date: Tue, 27 May 2003 21:05:07 +0200 Organization: Czech Technical University Message-ID: References: NNTP-Posting-Host: r2c113.mistral.cz X-Trace: ns.felk.cvut.cz 1054062307 40064 62.245.66.113 (27 May 2003 19:05:07 GMT) X-Complaints-To: usenet@ns.felk.cvut.cz NNTP-Posting-Date: Tue, 27 May 2003 19:05:07 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:37856 Date: 2003-05-27T21:05:07+02:00 List-Id: "Lutz Donnerhacke" wrote in message news:slrnbd6m69.vh.lutz@taranis.iks-jena.de... > * Sergey Koshcheyev wrote: > > I have this problem: I have a simple piece of code opening a file, > > reading a few lines, then closing it. Now, I want this piece of code to > > be "safe", i.e. not to leak any resources (the open file) in case of > > errors and not to propagate any exceptions. What is the best style to > > write this code? > > IMHO the most Ada Style solution is: Oh, well, but this is soo verbose... feels like using a cannon on flies. Sergey.