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,XPRIO 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: ANN: Adare_net Ada network lib Date: Mon, 27 Sep 2021 23:52:33 -0500 Organization: JSA Research & Innovation Message-ID: References: <3b6f0a2d-f3ba-45c8-9710-54d9edcf3fddn@googlegroups.com> <614502fd$0$1362$426a74cc@news.free.fr> Injection-Date: Tue, 28 Sep 2021 04:52:35 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="30107"; 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:62848 List-Id: "AdaMagica" wrote in message news:b1650e4c-90c6-4c75-8ee0-d7760f573320n@googlegroups.com... >> I agree with you Nicolas, they should not be declared Pure. It makes the >> GNAT compiler >> check for example that there are no global variables used in the packages >> but other than >> that, they (I didn't check all the packages) are not Pure. The pragma >> Pure worked as >> expected in Ada83 but the meaning and utility of it disappeared with the >> Ada95 standard. >There is no pragma Pure in Ada 83. Pragma Pure was an IMHO failed attempt to control/document access to globals. It has much too broad of a granularity to be very useful (I've never found anything that I could make Pure outside of language-defined things, and some of those cannot be implemented as Pure even though declared that way). Ada 2022 has aspect Global to do this properly, Global => null has many fewer holes than Pure. Note however that one can always lie about any Ada semantics in interfacing code. But any such lies make your code erroneous, and while it might work on one compiler today, there's no guarentee that it will work anywhere else (including the next update of your usual compiler). See B.1(38.1/5): It is the programmer's responsibility to ensure that the use of interfacing aspects does not violate Ada semantics; otherwise, program execution is erroneous. For example, passing an object with mode in to imported code that modifies it causes erroneous execution. Similarly, calling an imported subprogram that is not pure from a pure package causes erroneous execution. [The latter two sentences were added because programmers didn't seem to get what the first sentence means. We wanted that to be interpreted in the broadest possible way.] Randy.