From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:5755:: with SMTP id u82mr7499252ita.16.1548462153817; Fri, 25 Jan 2019 16:22:33 -0800 (PST) X-Received: by 2002:aca:cc0f:: with SMTP id c15mr2494oig.3.1548462153686; Fri, 25 Jan 2019 16:22:33 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.freedyn.net!news.dns-netz.com!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!k10no336122itk.0!news-out.google.com!v71ni417ita.0!nntp.google.com!q69no337058itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 25 Jan 2019 16:22:33 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=146.5.2.29; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.29 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <127bd95a-2c5b-4326-a4f6-c1e1538dd280@googlegroups.com> Subject: Re: ? Is ok return a type derived from ada.finalization.controlled from a "Pure_Function" ? thanks. From: Shark8 Injection-Date: Sat, 26 Jan 2019 00:22:33 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55375 Date: 2019-01-25T16:22:33-08:00 List-Id: On Thursday, January 24, 2019 at 4:56:12 PM UTC-7, Daniel Norte Moraes wrote: > Hi! > > Is ok return a type derived from ada.finalization.controlled > from a function declared "Pure_Function" ? IIRC, Pure_Function doesn't need to be in a Pure unit to be tagged as such, and the GNAT-specific meaning is: given a call with a particular set of parameter-values always returns the same result. As I recall GNAT doesn't actually check this is case, but rather uses it for optimization purposes. > > Or yet, is ok declare a fuction returning a controlled type as "pure_function" ? See above: "Pure_Function" has nothing to do with categorization or restrictions and is just an attribute denoting allowance for certain optimizations. (Again, IIRC.)