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 Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin3!goblin.stu.neva.ru!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Running a preprocessor from GPS? Date: Thu, 30 Jul 2015 13:55:58 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <2df4698f-4c8e-457c-822d-209cb2f8ab5e@googlegroups.com> <014427b1-ff7a-4a69-82e6-0330af77ed96@googlegroups.com> <91f88d79-197c-419f-84a8-908e05967a2c@googlegroups.com> <135c2b00-d13c-4f5d-a586-8aca442d363b@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1438282559 26088 24.196.82.226 (30 Jul 2015 18:55:59 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 30 Jul 2015 18:55:59 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.giganews.com comp.lang.ada:194543 Date: 2015-07-30T13:55:58-05:00 List-Id: "EGarrulo" wrote in message news:a10c8bc6-d5de-4b36-a15b-dd830c92c75b@googlegroups.com... ... > >> In Ada, use the stack, if possible! >> In Ada 2005, use containers, if possible! > > Otherwise use C++ and its "shared/weak pointer" support ;) We had a proposal for adding that to Ada, and it just was a complete mess. We simplified it to the basic subpool mechanism, which is a lot easier to understand and use (if not quite as safe, since it relies on the programmer to get the details right). But seriously, if you can't use the stack and/or containers in Ada 2005 and later, you're already into a fairly unlikely problem. And then you can use one of the various "smart pointer" packages out there; those do reference counting and hide that behind the various syntax sugar techniques of Ada 2012. (See Christophe Grein's package, for example.) There's an argument that one of those packages should get added to the Ada.Containers hierarchy (someone should propose that on Ada-Comment). Anyway, unless you are implementing a container, the need to use access types directly (and thus do the storage management directly) is pretty rare. And if you are implementing a container, you can limit the management to that container (thus taking the problem out of the hands of clients). Randy.