From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada Pure or Preelaborate or ? in Adare_net Date: Wed, 5 Jan 2022 17:40:04 -0600 Organization: JSA Research & Innovation Message-ID: References: <3b7ba153-ebf1-4b85-a1b2-3ad5aaeca11en@googlegroups.com> <546e54e7-64ba-48a5-a990-d644947992ccn@googlegroups.com> <378bc69a-8388-4daf-b13f-523fd1defa12n@googlegroups.com> Injection-Date: Wed, 5 Jan 2022 23:40:06 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="15306"; mail-complaints-to="news@jacob-sparre.dk" 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.7246 Xref: reader02.eternal-september.org comp.lang.ada:63347 List-Id: "Daniel Norte Moraes" wrote in message news:378bc69a-8388-4daf-b13f-523fd1defa12n@googlegroups.com... >Em terça-feira, 4 de janeiro de 2022 às 10:52:42 UTC-3, Fabien Chouteau >escreveu: >> On Friday, December 31, 2021 at 5:13:33 PM UTC+1, daniel...@gmail.com >> wrote: >> > For this reason, if really 'is' pure, not pure, preelaborate or what >> > (?), pleeeeeeaaase, we ask the group's Ada Language Lawyers to help >> > analyze and suggest modifications if necessary. >> I recommend reading this: >> https://stackoverflow.com/questions/19353228/when-to-use-pragma-pure-preelaborate >> >> If your units are declared as Pure, the compiler considers that they have >> no side effect and can decided to call the sub-programs only once and >> cache the result, or not even call the sub-program if the result is not >> used after. >Thanks! >I read the post and believe that because most variables are either streamed >or aliased and imported, lib works as it should. >However, there is still the possible problem of omitting the same >subprograms with the same parameters (by compiler), although in the tests >this did not happen, would replacing aspect 'pure' by 'preelaborate' solve >this possible problem? Yes. The permission to omit calls only applies to Pure (see 10.2.1(18/3)). http://www.ada-auth.org/standards/2xaarm/html/AA-10-2-1.html#p18. (I gave a reference to the Ada 2022 AARM, but this rule hasn't changed in spirit since it was introduced in Ada 95.) Randy.