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.224.126.137 with SMTP id c9mr27435774qas.2.1380930948631; Fri, 04 Oct 2013 16:55:48 -0700 (PDT) X-Received: by 10.50.39.78 with SMTP id n14mr456768igk.14.1380930948580; Fri, 04 Oct 2013 16:55:48 -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!a6no4262098qak.0!news-out.google.com!9ni11444qaf.0!nntp.google.com!i2no150589qav.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 4 Oct 2013 16:55:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.117.197.6; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 97.117.197.6 References: <61b58fde-2542-485a-a5e8-c7041ad822bd@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9006bf4b-e682-4803-a5e3-b0363ecb61d1@googlegroups.com> Subject: Re: ANN: PLplot plotting library with Ada bindings From: Jerry Injection-Date: Fri, 04 Oct 2013 23:55:48 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17398 Date: 2013-10-04T16:55:48-07:00 List-Id: On Tuesday, October 1, 2013 5:45:57 PM UTC-7, Jeffrey Carter wrote: > On 10/01/2013 05:31 PM, Jerry wrote: > > > > withPLplot; > > usePLplot; > > procedure Simple_Example is > > ... > > begin > > Initialize_PLplot; -- Call this only once. >=20 > Why doesn't the elaboration of Plplot do this? In some scenarios of PLplot usage, some set-up (i.e., other PLplot calls) i= s required before Initialize_Plot is called. Of course, this is a matter of= how the C library is designed, not the Ada bindings. > > ... > > End_PLplot; -- Call this only once. >=20 > Why not use finalization to do this? I don't think there are any issues analogous to the above. I might look int= o this; I think in the past I said, well if the user has to initialize, s/h= e might as well be bothered to finalize. I don't think it would be confusin= g to a user to be forced to explicitly initialize but not to explicitly fin= alize. I don't know what happens if the library doesn't get finalized but i= t probably ties up resources so an automatic process would be wise in that = sense. OTOH, with an opportunity to explicitly do the finalization, the use= r has the option to free those resources at a more optimal time. So the bes= t design might be to provide both finalization mechanisms. Jerry >=20 > --=20 > Jeff Carter > "This school was here before you came, > and it'll be here before you go." > Horse Feathers > 48