comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Krischik" <Martin.Krischik@T-Online.de>
Subject: Re: Prefix to 'ACCESS must either statically match... But why?
Date: Sun, 26 Jan 2003 10:57:36 +0100
Date: 2003-01-26T10:57:36+01:00	[thread overview]
Message-ID: <pan.2003.01.26.09.57.22.592384@T-Online.de> (raw)
In-Reply-To: 5ad0dd8a.0301251431.6370c6bc@posting.google.com

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




  reply	other threads:[~2003-01-26  9:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-25 22:31 Prefix to 'ACCESS must either statically match... But why? Wojtek Narczynski
2003-01-26  9:57 ` Martin Krischik [this message]
2003-01-27 19:30 ` Vadim Godunko
2003-01-28  4:42   ` GNAT / Aonix compiler incompatibility (Was: Prefix to 'ACCESS must either statically match... But why?) Wojtek Narczynski
  -- strict thread matches above, loose matches on Subject: below --
2003-01-27  6:41 Prefix to 'ACCESS must either statically match... But why? Grein, Christoph
2003-01-27 18:33 ` Martin Krischik
2003-01-27 19:05 ` Jeffrey Carter
2003-01-27  7:12 Grein, Christoph
2003-01-27 15:46 ` Wojtek Narczynski
2003-01-27 22:32   ` James S. Rogers
2003-01-28  2:51     ` Wojtek Narczynski
2003-01-28  3:19       ` James S. Rogers
2003-01-28 12:14         ` Wojtek Narczynski
2003-01-28 14:43           ` James S. Rogers
2003-01-28 20:20             ` Wojtek Narczynski
2003-01-28 21:36               ` James S. Rogers
2003-01-29  2:09                 ` tmoran
2003-01-29 11:21                 ` Wojtek Narczynski
2003-01-29  6:50 Grein, Christoph
2003-01-29 11:30 ` Wojtek Narczynski
2003-01-29 11:57 Grein, Christoph
2003-01-29 12:15 Grein, Christoph
2003-01-30  6:20 Grein, Christoph
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox