comp.lang.ada
 help / color / mirror / Atom feed
From: Egil H H <ehh.public@gmail.com>
Subject: Re: ANN: Adare_net Ada network lib
Date: Tue, 12 Oct 2021 12:44:32 -0700 (PDT)	[thread overview]
Message-ID: <8f565c79-f54c-4e60-a048-9bedde8757cfn@googlegroups.com> (raw)
In-Reply-To: <bf1b0481-dd93-41be-b966-81e330e182d1n@googlegroups.com>

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: 
> > Le 27/09/2021 à 06:32, Daniel Norte Moraes a écrit : 
> > > Em quarta-feira, 22 de setembro de 2021 às 08:07:06 UTC-3, joak...
> > >> onsdag 22 september 2021 kl. 11:16:13 UTC+2 skrev AdaMagica: 
> > >>>> 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. 
> > >> Thanks for clearing that up AdaMagica, I wasn't aware. 
> > >> 
> > >> Best regards, 
> > >> Joakim 
> > > 
> > > Really? They _are_ Pure. 
> > > I used linters extensively to result in this. one of these linters made hard use o gnat and gprbuild as his backend. 
> > > Remember this is target Ada 2012 (update 2016) and beyond => there is 
> > > 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... and this can still be "interfacially" pure; consider a FIBONACCI function which 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 [having (user-defined) static-functions would, in particular, allow some nice "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=1.15
http://ada-auth.org/standards/2xrm/html/RM-4-9.html
http://ada-auth.org/standards/2xrm/html/RM-6-8.html


-- 
~egilhh

  reply	other threads:[~2021-10-12 19:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-05  3:54 Daniel Norte Moraes
2021-09-17 21:04 ` DrPi
2021-09-22  8:47   ` Joakim Strandberg
2021-09-22  9:16     ` AdaMagica
2021-09-22 11:07       ` Joakim Strandberg
2021-09-27  4:32         ` Daniel Norte Moraes
2021-09-30 12:24           ` DrPi
2021-09-30 20:10             ` Daniel Norte Moraes
2021-10-01 17:33               ` DrPi
2021-10-01 19:11                 ` Simon Wright
2021-10-12 16:00                 ` Shark8
2021-12-30 21:15                 ` Daniel Norte Moraes
2021-10-12 15:49             ` Shark8
2021-10-12 19:44               ` Egil H H [this message]
2021-12-30 21:30                 ` Daniel Norte Moraes
2021-09-28  4:52       ` Randy Brukardt
2021-12-30 20:56         ` Daniel Norte Moraes
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox