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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,bfad7b01b410c9fb X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!u-picardie.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Pointer types (I mean access types) Date: Fri, 10 Jul 2009 20:23:36 -0500 Organization: Jacob Sparre Andersen Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1247275466 3470 69.95.181.76 (11 Jul 2009 01:24:26 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 11 Jul 2009 01:24:26 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news2.google.com comp.lang.ada:6970 Date: 2009-07-10T20:23:36-05:00 List-Id: "Rob Solomon" wrote in message news:t9lf55t55qh7puub368vnr55pf215d9nmh@4ax.com... >I am trying to understand how pointers work in Ada. I would like to > know if I have the correct equivalencies > > Assume this declaration: > type List_Node; -- An incomplete type declaration. > type List_Node_Access is access List_Node; > type List_Node is > record > Data : Integer; > Next : List_Node_Access; > end record; > > Ada Modula-2 (or Pascal) > -------------------------------- ---------------------- > type Node_Access is access Node; TYPE NodeAccess = POINTER TO Node; > Start : Node_Access; VAR Start : NodeAccess; > Current := new Node; Current := NEW(Node); > Current := Start; Current := Start; > Current.all := Start.all; Current^ := Start^; > Current.Data := 5; Current^.Data := 5; > > > I never learned C or derivatives. So comparisons to C don't help me. > > Thanks Looks right to me, although it has been so long since I used Pascal that I could have forgotten something. Randy.