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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ddbf85842f937132 X-Google-Attributes: gid103376,public From: matthew_heaney@acm.org (Matthew Heaney) Subject: Re: Self-referential 'Access Date: 1998/04/20 Message-ID: #1/1 X-Deja-AN: 346001710 Content-Transfer-Encoding: 8bit References: <353B4DC4.EB3650F4@ghg.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Organization: Network Intensive Newsgroups: comp.lang.ada Date: 1998-04-20T00:00:00+00:00 List-Id: In article <353B4DC4.EB3650F4@ghg.net>, Stanley Allen wrote: (start of quote) ------------ cellar.ads ----------- package Cellar is type Cell; type List is access all Cell; type Cell is limited record Contents : String (1 .. 10); Next_Cell : List := Cell'Access; --line 9 Prev_Cell : List := Cell'Access; --line 10 end record; end Cellar; ----------------------------------- Both compilers claim that the uses of the 'Access attribute are not valid because they violate the rules concerning depth of accessability. (end of quote) I don't know the exact rules here, but what I do in cases like this is just use Unchecked_Access: type Cell is limited record Contents : String (1 .. 10); Next_Cell : List := Cell'Unchecked_Access; Prev_Cell : List := Cell'Unchecked_Access; end record; This compiles cleanly using GNAT 3.10p.