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.246.168 with SMTP id xx8mr55681699obc.24.1435975364494; Fri, 03 Jul 2015 19:02:44 -0700 (PDT) X-Received: by 10.182.165.201 with SMTP id za9mr187273obb.19.1435975364457; Fri, 03 Jul 2015 19:02:44 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!ff1no1277827igc.0!news-out.google.com!t2ni3439igk.0!nntp.google.com!ff1no1939845igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 3 Jul 2015 19:02:44 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=174.28.156.122; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 174.28.156.122 References: <764f86ed-3b89-4631-b3f3-4d2b1b8d3df0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: How best to test for NULL in Ada? From: Shark8 Injection-Date: Sat, 04 Jul 2015 02:02:44 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:193904 Date: 2015-07-03T19:02:44-07:00 List-Id: On Thursday, July 2, 2015 at 6:12:53 PM UTC-6, Randy Brukardt wrote: > > In Ada 2012 there is a hack available to avoid the use clause. (This comes > from Tucker Taft, who admitted to doing this during our recent ARG meeting > in Madrid. He got suitable groans for this usage...) > > if Some_Object not in null then > > This membership uses the predefined equality for the type of Some_Object, > and it need not be visible. But this is a hack (it harms readability), and > it's dangerous if "=" has been redefined (as it always uses the predefined > "=", not the overridden one). Use at your own risk. Hm I can see where, if you were writing your own "=" operator for Some_Object's type and it was (a) an access type, and (b) you needed to test for null that could be useful.