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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a24:eec3:: with SMTP id b186-v6mr2247139iti.6.1521419861380; Sun, 18 Mar 2018 17:37:41 -0700 (PDT) X-Received: by 2002:a9d:578c:: with SMTP id q12-v6mr619177oth.4.1521419861185; Sun, 18 Mar 2018 17:37:41 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!news.roellig-ltd.de!open-news-network.org!peer01.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!199-v6no722502itl.0!news-out.google.com!h73-v6ni4307itb.0!nntp.google.com!199-v6no722500itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 18 Mar 2018 17:37:41 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.240.210.31; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.240.210.31 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: little precision about anonymous access types From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Mon, 19 Mar 2018 00:37:41 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 3031937016 X-Received-Bytes: 2077 Xref: reader02.eternal-september.org comp.lang.ada:51060 Date: 2018-03-18T17:37:41-07:00 List-Id: I have a little question about (anonymous) access types: I can do that: procedure main is type A is access INTEGER; A_O : A := new INTEGER'(54); begin declare B: access INTEGER; begin B := A_O; end; end main; But I can't do that, without being told A must be a general access type: procedure main is type A is access INTEGER; A_O : A; begin declare B: access INTEGER := new INTEGER'(7); begin A_O := A(B); end; end main; But I'm doing A_O := some_variable_of_the_stack'Access, I'm affecting A_O to another access object. Not taking an 'Access out of it. At first, I wondered what were the scope of declaration of anonymous access objects like B. Is: "B: access INTEGER := new INTEGER'(7);" STRICTLY equivalent to "type B_ANONYMOUS_TYPE is access INTEGER; B: B_ANONYMOUS_OBJECT;" chiefly regards to what and when I can affect things to of from anonymous access objects.