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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.126.137 with SMTP id my9mr2097589obb.13.1382727383215; Fri, 25 Oct 2013 11:56:23 -0700 (PDT) X-Received: by 10.50.109.170 with SMTP id ht10mr94013igb.14.1382727382918; Fri, 25 Oct 2013 11:56:22 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!o2no26534766qas.0!news-out.google.com!z6ni91529pbu.0!nntp.google.com!o2no26534753qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 25 Oct 2013 11:56:22 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=RxNzCgoAAACA5KmgtFQuaU-WaH7rjnAO NNTP-Posting-Host: 66.126.103.122 References: <5bae226f-91a2-4da0-a802-185a0de514f3@googlegroups.com> <0d509f96-1f16-4553-8e31-245ab7298322@googlegroups.com> <36a35fe3-58bf-44b4-af99-3d2c42b559ed@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <58d8b0f3-049a-465e-80bf-01b67c761de5@googlegroups.com> Subject: Re: How to do null comparision with pointers in ADA83? From: Adam Beneschan Injection-Date: Fri, 25 Oct 2013 18:56:22 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:17539 Date: 2013-10-25T11:56:22-07:00 List-Id: On Friday, October 25, 2013 11:48:05 AM UTC-7, seshuch...@gmail.com wrote: If AVL_Node_Ref is declared "type AVL_Node_Ref is private;" in package P, t= hen the only places where the program can tell it's an access type are in t= he private part of P (after the complete declaration is seen), and in the b= ody of P. (And, in Ada 95+, in some places in child packages.) Here, if y= ou're in another package, it won't be able to tell that AVL_Node_Ref is an = access type, even if you say "use P;". It only knows that it's a private t= ype. You should be able to compare two AVL_Node_Refs, since "=3D" is still= defined on private types. But you can't compare an AVL_Node_Ref to null, = since it's not allowed to know AVL_Node_Ref is an access type. When a package declares a private type, it also has to decide what operatio= ns on that type it wants to provide for other packages to use. Here, you p= robably want to declare a function like Is_Null in the public part of the p= ackage. Now other packages can use that function without having to know an= ything about AVL_Node_Ref's full definition. -- Adam