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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: The future of Spark . Spark 2014 : a wreckage Date: Fri, 19 Jul 2013 09:16:29 +0200 Organization: cbb software GmbH Message-ID: References: <1vc73wjwkqmnl$.gx86xaqy60u4$.dlg@40tude.net> <6pqhcwi0wuop.15v6h3g7gkto4.dlg@40tude.net> <1s6sw93u97355$.1n0205ucj6251.dlg@40tude.net> <1lhsyg46iz9jj.8jrvydqxt8l6.dlg@40tude.net> <1d4tuwlfdnz2j$.18l68s96x3vjj.dlg@40tude.net> <1rjye7dyn3vgk.66fbcca9y4zd.dlg@40tude.net> <1awbjaens2vca$.1asmpnthmmycl.dlg@40tude.net> <17i525dc26pat$.1octlzd41c8zm.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: IenaDxMXK2hi7fvYcb+MlQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:16426 Date: 2013-07-19T09:16:29+02:00 List-Id: On Thu, 18 Jul 2013 23:32:57 -0500, Randy Brukardt wrote: >> It won't be any more complex than it is when handling exceptions >> propagating out of Open. In fact it will be much simpler because you >> forgot the issue of closing the file on subsequent errors. > > I've never had the slightest "issue" with closing the file at the end. And > certainly, there aren't "subsequent errors", because either the file gets > opened eventually, or the whole routine is aborted (usually, the entire > program is halted at the point, since failure to be able to write results -- > no one needs to calculate results if you can't save them). I meant I/O errors and more elaborated cases like sockets. If you open a socket file you should bind it, set options which may fail as well. Code that does not use controlled wrappers look very ugly. It is *always* a much better design when the object maintains a state invariant (e.g. file is open). Provability of such code is a nice byproduct. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de