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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.82.115 with SMTP id n79mr19473219yhe.35.1382415614235; Mon, 21 Oct 2013 21:20:14 -0700 (PDT) X-Received: by 10.50.39.78 with SMTP id n14mr328703igk.14.1382415613804; Mon, 21 Oct 2013 21:20:13 -0700 (PDT) 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!news.glorb.com!i2no26220904qav.0!news-out.google.com!z6ni85598pbu.0!nntp.google.com!o2no18673142qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 21 Oct 2013 21:20:13 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.117.192.41; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 97.117.192.41 References: <61b58fde-2542-485a-a5e8-c7041ad822bd@googlegroups.com> <9006bf4b-e682-4803-a5e3-b0363ecb61d1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <46f45da1-4cb9-4fbf-a055-d4a9f6693dc6@googlegroups.com> Subject: Re: ANN: PLplot plotting library with Ada bindings From: Jerry Injection-Date: Tue, 22 Oct 2013 04:20:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:17491 Date: 2013-10-21T21:20:13-07:00 List-Id: On Friday, October 18, 2013 7:27:50 PM UTC-7, Randy Brukardt wrote: > "Jerry" wrote in message > On Tuesday, October 1, 2013 5:45:57 PM UTC-7, Jeffrey Carter wrote: > > On 10/01/2013 05:31 PM, Jerry wrote: > ... > >> > ... > >> > End_PLplot; -- Call this only once. > >> > >> Why not use finalization to do this? > > > >... > >I don't know what happens if the library doesn't get finalized but it > >probably ties up > >resources so an automatic process would be wise in that sense. > > The problem with requiring manual finalization is that it doesn't work when > the program propagates an exception. In that case, the user's explicit call > doesn't get executed. You could try to require them to handle such > exceptions and do the finalization in a handler, but that's both a mess and > something that's easy to forget. And even that doesn't work in the face of > abort (although that's probably not a significant concern in this case). > > Thus, I think you always want automatic finalization if any is needed. It > might make sense to also support a manual version (especially in this case, > where you wouldn't want to force an incompatibility on any of your users, > which you would if you completely got rid of the End_PLPlot routine.) -- but > you don't want that manual version to be required. (Of course, this assumes > that the finalization actually does something important; if the OS cleans up > well enough after an program that terminated unexpectedly, then this doesn't > apply.) > > Even if *correct* programs would be fine with manual finalization, remember > that the program will fail many times while you're creating and debugging > it. You don't want that to suck up resources on the user's computer. > > Randy. Good point. Thanks, Randy. I think I'll work this into the next release. Jerry