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 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: We should introduce aliased types Date: Fri, 01 Aug 2014 22:57:21 +0300 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:188085 Date: 2014-08-01T22:57:21+03:00 List-Id: Randy Brukardt wrote: > "Victor Porton" wrote in message > news:lrgp2h$h3n$1@speranza.aioe.org... > ... >> One situation in which we need aliased types (not a single aliased >> variable) >> is Initialize() procedure for controlled types. > > This is already true. Controlled types are by-reference, so it's legal to > take 'Access of a subprogram parameter of the type. Specifically: > > procedure Initialize (Obj : T) is > begin > Obj.Ptr := T'Unchecked_Access; > end Initialize; > > is legal. > > Did you actually try this before writing?? Sorry, Randy. I've tried but not with a tagged type. Now I see it does already work with tagged types. -- Victor Porton - http://portonvictor.org