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=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a37:9cd:: with SMTP id 196mr13855224qkj.22.1634053797326; Tue, 12 Oct 2021 08:49:57 -0700 (PDT) X-Received: by 2002:a25:ce14:: with SMTP id x20mr30142816ybe.139.1634053797163; Tue, 12 Oct 2021 08:49:57 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 12 Oct 2021 08:49:56 -0700 (PDT) In-Reply-To: <6155ac7f$0$6454$426a34cc@news.free.fr> Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 References: <3b6f0a2d-f3ba-45c8-9710-54d9edcf3fddn@googlegroups.com> <614502fd$0$1362$426a74cc@news.free.fr> <6155ac7f$0$6454$426a34cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: ANN: Adare_net Ada network lib From: Shark8 Injection-Date: Tue, 12 Oct 2021 15:49:57 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62980 List-Id: On Thursday, September 30, 2021 at 6:24:34 AM UTC-6, DrPi wrote: > Le 27/09/2021 =C3=A0 06:32, Daniel Norte Moraes a =C3=A9crit :=20 > > Em quarta-feira, 22 de setembro de 2021 =C3=A0s 08:07:06 UTC-3, joak...= =20 > >> onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica:=20 > >>>> 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 use= d in the packages but other than that, they (I didn't check all the package= s) are not Pure. The pragma Pure worked as expected in Ada83 but the meanin= g and utility of it disappeared with the Ada95 standard.=20 > >>> There is no pragma Pure in Ada 83.=20 > >> Thanks for clearing that up AdaMagica, I wasn't aware.=20 > >>=20 > >> Best regards,=20 > >> Joakim=20 > >=20 > > Really? They _are_ Pure.=20 > > I used linters extensively to result in this. one of these linters made= hard use o gnat and gprbuild as his backend.=20 > > Remember this is target Ada 2012 (update 2016) and beyond =3D> there is= =20 > > no guarantee of operation for Ada versions earlier than Ada2012. > In a Pure package, shouldn't the subprograms also be Pure ? Yes...ish. As mentioned upthread, you can lie about there being no internal state... a= nd this can still be "interfacially" pure; consider a FIBONACCI function wh= ich is memoized (Function F(N: Positive) return Positive) -- internally it = has the memo to look up F(N), which is obviously state, but externally any = F(X) will return the same value given the same inputs. / Perhaps we should = allow aspect PURE on subprograms, as well as introduce an aspect STATIC [ha= ving (user-defined) static-functions would, in particular, allow some nice = "macro-lite" functionality].