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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How best to test for NULL in Ada? Date: Fri, 3 Jul 2015 09:30:00 +0200 Organization: cbb software GmbH Message-ID: <15ijitqkqlg8h.17vgpafqq0fg4$.dlg@40tude.net> References: <764f86ed-3b89-4631-b3f3-4d2b1b8d3df0@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: enOx0b+nfqkc2k+TNpOejg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:26577 Date: 2015-07-03T09:30:00+02:00 List-Id: On Thu, 02 Jul 2015 16:19:22 -0700, Jeffrey R. Carter wrote: > The path returned has type Gtk.Tree_Model.Gtk_Tree_Path, which is a tagged > record type. Since it's not an access type, you can't compare it to null. You > have to compare it to a value of type Gtk.Tree_Model.Gtk_Tree_Path. Yes. There is the Null_Gtk_Tree_Path constant for that. Gtk_Tree_Path is a wrapped pointer. One thing Ada should have is the abstract access type to have such wrappers derived from, and thus making comparison to null legal (instead of the implicit dereference hack). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de