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:b045:: with SMTP id z66mr21497315qke.271.1634067872510; Tue, 12 Oct 2021 12:44:32 -0700 (PDT) X-Received: by 2002:a25:81d1:: with SMTP id n17mr5580669ybm.425.1634067872334; Tue, 12 Oct 2021 12:44:32 -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 12:44:32 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=81.167.0.45; posting-account=uulyKwoAAAA86DO0ODu--rZtbje8Sytn NNTP-Posting-Host: 81.167.0.45 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: <8f565c79-f54c-4e60-a048-9bedde8757cfn@googlegroups.com> Subject: Re: ANN: Adare_net Ada network lib From: Egil H H Injection-Date: Tue, 12 Oct 2021 19:44:32 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62986 List-Id: On Tuesday, October 12, 2021 at 5:49:58 PM UTC+2, Shark8 wrote: > On Thursday, September 30, 2021 at 6:24:34 AM UTC-6, DrPi wrote:=20 > > 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.= .. > > >> 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 mak= es the GNAT compiler check for example that there are no global variables u= sed in the packages but other than that, they (I didn't check all the packa= ges) are not Pure. The pragma Pure worked as expected in Ada83 but the mean= ing 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 ma= de 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.=20 > > In a Pure package, shouldn't the subprograms also be Pure ? > Yes...ish.=20 > As mentioned upthread, you can lie about there being no internal state...= and this can still be "interfacially" pure; consider a FIBONACCI function = which is memoized (Function F(N: Positive) return Positive) -- internally i= t has the memo to look up F(N), which is obviously state, but externally an= y F(X) will return the same value given the same inputs. / Perhaps we shoul= d allow aspect PURE on subprograms, as well as introduce an aspect STATIC [= having (user-defined) static-functions would, in particular, allow some nic= e "macro-lite" functionality]. Well, aspect Static for expression functions is coming... http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0075-1.txt?rev=3D1.15 http://ada-auth.org/standards/2xrm/html/RM-4-9.html http://ada-auth.org/standards/2xrm/html/RM-6-8.html --=20 ~egilhh