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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,60d761814c33393c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-10 18:31:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!c03.atl99!news.webusenet.com!pc01.webusenet.com!fe03.atl2.webusenet.com.POSTED!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada References: Subject: Re: Qs re 'Write & 'Read MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Tue, 10 Jun 2003 21:21:48 EDT Date: Tue, 10 Jun 2003 20:31:36 -0500 Xref: archiver1.google.com comp.lang.ada:38944 Date: 2003-06-10T20:31:36-05:00 List-Id: wrote in message news:nOtFa.1188350$F1.139910@sccrnsc04... > >Maybe my mind's just in a fog today, but please explain why there'd be > >a problem with any kind of access type -- general, or not, using my > >approach. > Aliasing. > type phs is access integer; > type pgs is access all integer; > type r is record > i : aliased integer; > ph : phs; > pg : pgs; > end record; > x : r; > begin > x.ph := new integer; > x.pg := x.i'access; > but on reading it back in, you can tell both x.ph and x.pg are non-null, > but you don't know whether x.pg should allocate from the heap or point > to some existing (stack) object. Well, for the life of me, I can't see why anyone would need to do what your example does. If, indeed, an access component of a record designates an aliased component, then it seems to me that one would need an overridden set of stream attributes for the whole record. Writing r.pg to the stream would be meaningless, since it designates data already written to the stream. The read attribute would simply make the assignment r.pg = r.i'access, after having read r.i from the stream. > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > >