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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6d748e86b56b1269 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-26 05:21:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Martin Krischik" Newsgroups: comp.lang.ada Subject: Re: Prefix to 'ACCESS must either statically match... But why? Date: Sun, 26 Jan 2003 10:57:36 +0100 Organization: never organized Message-ID: References: <5ad0dd8a.0301251431.6370c6bc@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 X-Trace: news.t-online.com 1043587023 03 11021 TCRaE1sTSLAcuD 030126 13:17:03 X-Complaints-To: abuse@t-online.com X-Sender: 05341395658-0001@t-dialin.net User-Agent: Pan/0.13.0 (The whole remains beautiful) Xref: archiver1.google.com comp.lang.ada:33436 Date: 2003-01-26T10:57:36+01:00 List-Id: On Sat, 25 Jan 2003 14:31:17 +0000, Wojtek Narczynski wrote: > Path: > news.t-online.com!newsmm00.sul.t-online.com!newsfeed01.sul.t-online.de!t-on > line.de!newsfeed.stueberl.de!logbridge.uoregon.edu!newsfeed.stanford.edu!po > stnews1.google.com!not-for-mail > Message-ID: <5ad0dd8a.0301251431.6370c6bc@posting.google.com> > From: wojtek@power.com.pl (Wojtek Narczynski) > Newsgroups: comp.lang.ada > Subject: Prefix to 'ACCESS must either statically match... But why? > Date: 25 Jan 2003 14:31:17 -0800 > Lines: 25 > Organization: http://groups.google.com/ > NNTP-Posting-Host: 212.160.20.107 > X-Trace: posting.google.com 1043533877 23863 127.0.0.1 (25 Jan 2003 22:31:17 > GMT) > X-Complaints-To: groups-abuse@google.com > NNTP-Posting-Date: 25 Jan 2003 22:31:17 GMT > Xref: linux1.krischik.com comp.lang.ada:581 > MIME-Version: 1.0 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: 8bit > > > Hello, > > Could somebody please explain me why is this rule present? I find it > very limting. Is this because AR2 bounds are not stored with the > object? > > Type Stream_Element_Array_access is access all Stream_Element_Array; > > AR1 : aliased Stream_Element_Array := ( 2, 4, 5 ); > AR2 : aliased Stream_Element_Array ( 1 .. 3 ) := ( 2, 4, 5 ); > > AR1A : Stream_Element_Array_access := AR1'access; > > -- Illegal > AR2A : Stream_Element_Array_access := AR2'access; > > > LRM:3.10.2(27), The nominal subtype of the prefix to 'ACCESS or > 'UNCHECKED_ACCESS must either statically match the designated subtype > of the expected type or the designated subtype must be discriminated > and unconstrained, Continuing Well I am a Ada-beginner myself so I might be wrong, but as far as I understand strictly typed languages in general "Stream_Element_Array ( 1 .. 3 )" is a new anonymous type which ist not a Stream_Element_Array anymore. A bit like typing Type Stream_Element_Array_AR2 is new Stream_Element_Array ( 1 .. 3 ); AR2 : aliased Stream_Element_Array_AR2 := ( 2, 4, 5 ); Hope it helps Martin -- Martin Krischik mailto://Martin@krischik.com http://www.ada.krischik.com