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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Thu, 10 Mar 2005 11:13:20 +0100 Message-ID: <42301DC0.2050700@mailinator.com> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1110377260.350158.58730@z14g2000cwz.googlegroups.com> <422f0c08$1_1@baen1673807.greenlnk.net> <422F142E.9050909@mailinator.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net L7zMHq6Nk/u5n+pZTH5law+g2ZFIALrML6X0pUQdYhx4UFiyE= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:9019 Date: 2005-03-10T11:13:20+01:00 List-Id: Randy Brukardt wrote: > "Alex R. Mosteo" wrote in message > news:422F142E.9050909@mailinator.com... > >>This is something I don't fully understand. IFAIK, >> >>procedure Proc (Blah : access Some_Type); >> >>access parameters raise an excepcion if null. > > > Not in Ada 2005. Ahhh. Here is the trick :) I must re-read the gnat advance on 2005 features. There are a lot of exciting changes coming. > That restriction makes it very difficult to do C > interfacing, among other things. Moreover, keeping the restriction would > have made the expansion of anonymous access types to most contexts unusable > (you need a null value sometimes!). The only case where "not null" is > implicit is if the parameter is controlling (that's necessary for > compatibility - I think most of us hate it, but there doesn't seem to be an > alternative). > > >>So I don't get what adds >>to the language the >> >>Blah : not null access ... >> >>construct. > > > Because it (a) makes the restriction explicit, and (b) you can use it > anywhere: on named access types, on variables and components, in generic > formals, etc. > > type Acc is access Some_Type; > procedure Proc (P : in not null Acc); > > Randy Brukardt