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:a05:620a:3187:: with SMTP id bi7mr23430957qkb.534.1640897764889; Thu, 30 Dec 2021 12:56:04 -0800 (PST) X-Received: by 2002:a25:6884:: with SMTP id d126mr14266121ybc.355.1640897764710; Thu, 30 Dec 2021 12:56:04 -0800 (PST) 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: Thu, 30 Dec 2021 12:56:04 -0800 (PST) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2804:14c:4c1:8775:352d:ffd4:3db5:6282; posting-account=wgmHdgoAAAA-F7JItPEZjeXqFc0KdzEQ NNTP-Posting-Host: 2804:14c:4c1:8775:352d:ffd4:3db5:6282 References: <3b6f0a2d-f3ba-45c8-9710-54d9edcf3fddn@googlegroups.com> <614502fd$0$1362$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6bb14593-5270-4945-8491-1d422bea6deen@googlegroups.com> Subject: Re: ANN: Adare_net Ada network lib From: Daniel Norte Moraes Injection-Date: Thu, 30 Dec 2021 20:56:04 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:63312 List-Id: Em ter=C3=A7a-feira, 28 de setembro de 2021 =C3=A0s 01:52:37 UTC-3, Randy B= rukardt escreveu: > "AdaMagica" wrote in message=20 > news:b1650e4c-90c6-4c75...@googlegroups.com... > >> I agree with you Nicolas, they should not be declared Pure. It makes t= he=20 > >> GNAT compiler=20 > >> check for example that there are no global variables used in the packa= ges=20 > >> but other than=20 > >> that, they (I didn't check all the packages) are not Pure. The pragma= =20 > >> Pure worked as=20 > >> expected in Ada83 but the meaning and utility of it disappeared with t= he=20 > >> Ada95 standard.=20 >=20 > >There is no pragma Pure in Ada 83. > Pragma Pure was an IMHO failed attempt to control/document access to=20 > globals. It has much too broad of a granularity to be very useful (I've= =20 > never found anything that I could make Pure outside of language-defined= =20 > things, and some of those cannot be implemented as Pure even though decla= red=20 > that way). Ada 2022 has aspect Global to do this properly, Global =3D> nu= ll=20 > has many fewer holes than Pure.=20 >=20 > Note however that one can always lie about any Ada semantics in interfaci= ng=20 > code. But any such lies make your code erroneous, and while it might work= on=20 > one compiler today, there's no guarentee that it will work anywhere else= =20 > (including the next update of your usual compiler). See B.1(38.1/5):=20 >=20 > It is the programmer's responsibility to ensure that the use of=20 > interfacing aspects does=20 > not violate Ada semantics; otherwise, program execution is erroneous. For= =20 > example,=20 > passing an object with mode in to imported code that modifies it causes= =20 > erroneous=20 > execution. Similarly, calling an imported subprogram that is not pure fro= m=20 > a pure=20 > package causes erroneous execution.=20 >=20 > [The latter two sentences were added because programmers didn't seem to g= et=20 > what the first sentence means. We wanted that to be interpreted in the=20 > broadest possible way.]=20 >=20 > Randy. We apologize for the delay in responding. I (daniel) was expecting the 'sta= tic aspect' to have more support (I gotted this suggestion, and thanks to you who suggested i= t). With the development release of gnat-12 I'll try to answer all the question= s and make all the suggested changes that make sense. Really Randy, I'm aware about this.=20 I=C2=B4ll try answer in order: 1) var'address as mode in: the address in the import functions and procedur= es don't are changed. when there are a change, the change is just=20 in the data that address point to. this is a standard pratice in ada bi= nd world. we dont use 'in out' mode because the address don't are changed. 2) object'address and for object'address use 'var': a) remember by the = src code, the true 'lengths' are saved and used without violate the address space (really this is my responsability as programmmer)= b) and=20 (besides some bug by off-one not yet hunted). c) this is sure enforced. d= ) I get a instantaneos segfault if this=20 dont are enforced. e) this 'enforcement' is transparent to user. f) the use= r dont have access to this 'internals' , It is isolated from his/her. 3) besides an aparent violation, a) this was necessary to get values, in re= ality a 'view change' to get the real values. compilers obligied me=20 to do this, afters some months, figthing against some linux patchs (permant= ent patchs) and segfault in mswindows. Besides the harmless and legitimate = use without 'view change', gcc gnat linux and mswindows dont permited this. 4) import var convention c: a) the mostly vars is embedded from _c vars in = adare-net c sources_. the Ada RM made a excption in this case when this is imported vars. etc. >From now: I can transform mostly imported vars in static functions. Pleeease All, Say us What you want and or What you complains(with filename= and line_number) and yours sugestions. Ah! The Version of Ada is 202x. Enjoy with us! Best Whishes, Dani.