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=2.1 required=5.0 tests=BAYES_05,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!mcvax!dik From: dik@mcvax.UUCP Newsgroups: comp.lang.ada Subject: Re: A Problem With Access Types Message-ID: <347@zuring.mcvax.cwi.nl> Date: Sun, 12-Apr-87 11:44:26 EST Article-I.D.: zuring.347 Posted: Sun Apr 12 11:44:26 1987 Date-Received: Tue, 14-Apr-87 00:05:06 EST References: <9954@skl-crc.ARPA> <124000003@inmet> Reply-To: dik@zuring.UUCP (Dik T. Winter) Organization: CWI, Amsterdam List-Id: In article <124000003@inmet> callen@inmet.UUCP writes: > > Try something like this (but be forewarned that the code is not necessarily > going to be portable): Nor is it going to be fool-proof. > > with Unchecked_Conversion; > with System; > ... > type A_REC is > record > ... > end; > > type A_ACCESS is access A_REC; > > function Make_Pointer is new Unchecked_Conversion( > SOURCE=>System.Address, TARGET=>A_ACCESS); > > A : A_REC; > A_A : A_ACCESS; Ah, yes, the pointer to the stack. Note however that your contents might get lost while youre pointer still exists. (And no, you do not need UNCHECKED_DEALLOCATION; the contents will deallocate themselves.) Useful? Maybe. Portable? Probably yes. Advisable? Definitely no. -- dik t. winter, cwi, amsterdam, nederland INTERNET : dik@cwi.nl BITNET/EARN: dik@mcvax