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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9a7ca14e457ad414,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-11 18:39:46 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!swrinde!hopper.acm.org!ACM.ORG!PAPAY From: papay@ACM.ORG (There can be only one) Newsgroups: comp.lang.ada Subject: Ada 9X question: accessibility Date: 11 Nov 1994 19:47:23 GMT Organization: ACM Network Services Message-ID: <3a0hob$h5f@hopper.acm.org> Reply-To: papay@ACM.ORG NNTP-Posting-Host: acm.org Date: 1994-11-11T19:47:23+00:00 List-Id: I was reading over the Ada 9X Reference Manual section on Access Types and wanted to make sure I understood "accessibility" correctly. I would appreciate any comments/confirmation on the following: procedure Example is type Access_Integer_Type is access all Integer; Ptr_1 : Access_Integer_Type; Int_1 : aliased Integer; begin Local_Block: declare Ptr_2 : Access_Integer_Type; Int_2 : aliased Integer; begin Ptr_1 := Int_1'Access; -- Legal. Ptr_1 := Int_2'Access; -- Illegal. Ptr_2 := Int_1'Access; -- Legal? Ptr_2 := Int_2'Access; -- Illegal? end Local_Block; end Example; As I understand it, the first assignment statement is legal, but the second one is not because Int_2 is not dynamically accessible from the access type Access_Integer_Type (and it's pretty obvious this would leave a dangling reference). What about the last two assignment statements? Thanks in advance for your comments/help. | | David Papay | o | papay@acm.org (preferred) | ^/--- | dpapay@aol.com (alternate) | /> | | | | fleche! |