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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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-27 19:19:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn11feed!wn13feed!wn12feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Reply-To: "James S. Rogers" From: "James S. Rogers" Newsgroups: comp.lang.ada References: <5ad0dd8a.0301270746.6ad4c4b0@posting.google.com> <5ad0dd8a.0301271851.7c907f60@posting.google.com> Subject: Re: Prefix to 'ACCESS must either statically match... But why? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Tue, 28 Jan 2003 03:19:45 GMT NNTP-Posting-Host: 12.86.37.143 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1043723985 12.86.37.143 (Tue, 28 Jan 2003 03:19:45 GMT) NNTP-Posting-Date: Tue, 28 Jan 2003 03:19:45 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:33472 Date: 2003-01-28T03:19:45+00:00 List-Id: "Wojtek Narczynski" wrote in message news:5ad0dd8a.0301271851.7c907f60@posting.google.com... > "James S. Rogers" wrote in message news:... > > > If you want to use a more general access to string try using an access > > to an unbounded string. See the following: > > Uhm, I switched to String from Stream_Element_Array because the old > GNAT code example used it. In my project there is something like this: > > subtype Content_Length_Type is > Stream_Element_Count range 0 .. 2 ** 16 - 1; > subtype Padding_Length_Type > is Stream_Element_Count range 0 .. 2 ** 8 - 1; > > type Content_Type > ( Content_Length : Content_Length_Type; > Padding_Length : Padding_Length_Type ) > is record > Content : aliased Stream_Element_Array( 1..Content_Length ); > case Padding_Length is > when 0 => null; > when others => Padding : Stream_Element_Array( 1..Padding_Length > ); > end case; > end record; > > > First I read a header with Content_Length and Padding_Length from > socket, then I use declare to read the actual content in another > syscall. > > Then I wanted to pass the access to Content to a function that accepts > access Stream_Element_Array as its parameter. Looks like this cannot > be done though. Why are you choosing to pass an access to a Stream_Element_Array instead of just the Stream_Element_Array? Avoiding the use of an access type would also eliminate the problem. Remember that any parameter, even an IN parameter can be passed by reference by the compiler. In fact, an array object is most frequently passed by reference. > > And in general I find the inablility to declare access type subtypes > in parallel with the subtypes for the designated type obstructive. It appears that you are thinking in C while programming in Ada. Jim Rogers