From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 24 May 93 02:03:26 GMT From: jeol!weimer@uunet.uu.net (Allan Weimer) Subject: Re: Access type question ... Message-ID: List-Id: In biao@mamba.cs.unm.edu (Biao Wang) writes: >I have a question about the ADA access type. This is my program -- >with TEXT_IO; >use TEXT_IO; >procedure DYNAMIC_ALLOCATION is > package IO_INTEGER is new INTEGER_IO(INTEGER); > use IO_INTEGER; > type POINTER is access INTEGER; > A, B : POINTER; >begin > A := new POINTER'(10); > ... Allocation takes place the base type (what the pointer is pointing to). Change the line above to: A := new INTEGER'(10); To make this clear, and remember what the base type is for an access, I usually use the convention of naming my access types like: type A_INTEGER is access INTEGER; -- Allan Weimer JEOL USA Inc. (weimer@jeol.com)