Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

You mean you didn't *know* she was off making lots of little phone companies?


devel / comp.lang.ada / About procedures and functions in Ada Pure packages. Thanks!

SubjectAuthor
* About procedures and functions in Ada Pure packages. Thanks!Daniel Norte Moraes
`* Re: About procedures and functions in Ada Pure packages. Thanks!Randy Brukardt
 `- Re: About procedures and functions in Ada Pure packages. Thanks!Daniel Norte Moraes

1
About procedures and functions in Ada Pure packages. Thanks!

<e1f43654-dba6-46d7-bcd9-4aa79ed82f74n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8611&group=comp.lang.ada#8611

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:e185:0:b0:474:7ab8:1eaf with SMTP id p5-20020a0ce185000000b004747ab81eafmr13142796qvl.76.1660559515642;
Mon, 15 Aug 2022 03:31:55 -0700 (PDT)
X-Received: by 2002:a05:6902:1028:b0:686:c4c2:2315 with SMTP id
x8-20020a056902102800b00686c4c22315mr5469051ybt.509.1660559515385; Mon, 15
Aug 2022 03:31:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 15 Aug 2022 03:31:55 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=187.106.43.228; posting-account=wgmHdgoAAAA-F7JItPEZjeXqFc0KdzEQ
NNTP-Posting-Host: 187.106.43.228
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e1f43654-dba6-46d7-bcd9-4aa79ed82f74n@googlegroups.com>
Subject: About procedures and functions in Ada Pure packages. Thanks!
From: danielcheagle@gmail.com (Daniel Norte Moraes)
Injection-Date: Mon, 15 Aug 2022 10:31:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1868
 by: Daniel Norte Moraes - Mon, 15 Aug 2022 10:31 UTC

Hi! and Very Very Very Thanks!

I building and change some packages and I have some doubts
about procedures and functions in Ada Pure packages.
I'm asking mainly the Ada Language Lawers. the Ada version is Ada2012.

fact 1: Ada allow the compiler substitute a function with
the result of this function.

?This is valid to functions with 'in out' or 'out' parameters ?
?This is valid to functions with 'not null access' parameters ?
?This is valid to procedures with 'in out' or 'out' parameters ?
?This is valid to procedures with 'not null access' parameters ?

?If they are replaced (on the second call onwards) by the result,
will the 'in' 'in out' and 'not null access' parameters be updated
if they are changed within the function or procedure?

Very Very Very Thanks in Advance!
Best Wishes,
GrateFull,
Dani.

Re: About procedures and functions in Ada Pure packages. Thanks!

<tdk3ll$lg4s$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8617&group=comp.lang.ada#8617

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: randy@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: About procedures and functions in Ada Pure packages. Thanks!
Date: Wed, 17 Aug 2022 20:12:20 -0500
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <tdk3ll$lg4s$1@dont-email.me>
References: <e1f43654-dba6-46d7-bcd9-4aa79ed82f74n@googlegroups.com>
Injection-Date: Thu, 18 Aug 2022 01:12:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="2622ec0c9258f639e76de0fc1eae5c69";
logging-data="704668"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1946jcpfxhF0SpAtzPEUQy9tVQvx+dEfHw="
Cancel-Lock: sha1:3uASthn5PNmVGCc2pQrLEzDXwaE=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-MSMail-Priority: Normal
X-RFC2646: Format=Flowed; Original
 by: Randy Brukardt - Thu, 18 Aug 2022 01:12 UTC

"Daniel Norte Moraes" <danielcheagle@gmail.com> wrote in message
news:e1f43654-dba6-46d7-bcd9-4aa79ed82f74n@googlegroups.com...
> Hi! and Very Very Very Thanks!
>
> I building and change some packages and I have some doubts
> about procedures and functions in Ada Pure packages.
> I'm asking mainly the Ada Language Lawers. the Ada version is Ada2012.
>
> fact 1: Ada allow the compiler substitute a function with
> the result of this function.
>
> ?This is valid to functions with 'in out' or 'out' parameters ?
> ?This is valid to functions with 'not null access' parameters ?
> ?This is valid to procedures with 'in out' or 'out' parameters ?
> ?This is valid to procedures with 'not null access' parameters ?

Yes, but there is a requirement that the input *values* are the same on both
calls, and in the case of access types, everything reachable is the same on
both calls. See 10.2.1(18/3) --
http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-10-2-1.html#p18

Practically, compilers will exclude some or all of these cases.

> ?If they are replaced (on the second call onwards) by the result,
> will the 'in' 'in out' and 'not null access' parameters be updated
> if they are changed within the function or procedure?

If the "in out" parameters are changed, then the values don't match on the
second call, and the optimization isn't allowed. If the values are changed
to the *same* value as original, the optimization would be allowed, but you
couldn't tell whether or not the values were changed, so I think the
question is moot in that case.

Again, I doubt that an actual compiler would try to optimize in such cases
(too hard to prove that they're OK).

Randy.

Re: About procedures and functions in Ada Pure packages. Thanks!

<1d93145f-7da3-4a02-b0f7-5ae5c38dedb4n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=8623&group=comp.lang.ada#8623

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:1986:b0:343:225d:f9e1 with SMTP id u6-20020a05622a198600b00343225df9e1mr13530684qtc.651.1661118542588;
Sun, 21 Aug 2022 14:49:02 -0700 (PDT)
X-Received: by 2002:a0d:cdc2:0:b0:335:debd:2b3d with SMTP id
p185-20020a0dcdc2000000b00335debd2b3dmr16903883ywd.19.1661118542407; Sun, 21
Aug 2022 14:49:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 21 Aug 2022 14:49:02 -0700 (PDT)
In-Reply-To: <tdk3ll$lg4s$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=187.106.43.228; posting-account=wgmHdgoAAAA-F7JItPEZjeXqFc0KdzEQ
NNTP-Posting-Host: 187.106.43.228
References: <e1f43654-dba6-46d7-bcd9-4aa79ed82f74n@googlegroups.com> <tdk3ll$lg4s$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1d93145f-7da3-4a02-b0f7-5ae5c38dedb4n@googlegroups.com>
Subject: Re: About procedures and functions in Ada Pure packages. Thanks!
From: danielcheagle@gmail.com (Daniel Norte Moraes)
Injection-Date: Sun, 21 Aug 2022 21:49:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3254
 by: Daniel Norte Moraes - Sun, 21 Aug 2022 21:49 UTC

Em quarta-feira, 17 de agosto de 2022 às 22:12:24 UTC-3, Randy Brukardt escreveu:
> "Daniel Norte Moraes" <daniel...@gmail.com> wrote in message
> news:e1f43654-dba6-46d7...@googlegroups.com...
> > Hi! and Very Very Very Thanks!
> >
> > I building and change some packages and I have some doubts
> > about procedures and functions in Ada Pure packages.
> > I'm asking mainly the Ada Language Lawers. the Ada version is Ada2012.
> >
> > fact 1: Ada allow the compiler substitute a function with
> > the result of this function.
> >
> > ?This is valid to functions with 'in out' or 'out' parameters ?
> > ?This is valid to functions with 'not null access' parameters ?
> > ?This is valid to procedures with 'in out' or 'out' parameters ?
> > ?This is valid to procedures with 'not null access' parameters ?
> Yes, but there is a requirement that the input *values* are the same on both
> calls, and in the case of access types, everything reachable is the same on
> both calls. See 10.2.1(18/3) --
> http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-10-2-1.html#p18
>
> Practically, compilers will exclude some or all of these cases.
> > ?If they are replaced (on the second call onwards) by the result,
> > will the 'in' 'in out' and 'not null access' parameters be updated
> > if they are changed within the function or procedure?
> If the "in out" parameters are changed, then the values don't match on the
> second call, and the optimization isn't allowed. If the values are changed
> to the *same* value as original, the optimization would be allowed, but you
> couldn't tell whether or not the values were changed, so I think the
> question is moot in that case.
>
> Again, I doubt that an actual compiler would try to optimize in such cases
> (too hard to prove that they're OK).
>
> Randy.

Thanks Randy!

I'm satisfied.

Very Very Very GrateFull,
Best Wishes,
Dani.


devel / comp.lang.ada / About procedures and functions in Ada Pure packages. Thanks!

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor