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=ham 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!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.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:11:05 +0100 Message-ID: <42301D39.6080708@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 cuWpL3FspIR5CPntzNGqWg33NKRIud8Qt7X3DCIT/n3Xh5/UE= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:9018 Date: 2005-03-10T11:11:05+01:00 List-Id: Mark Lorenzen wrote: > "Alex R. Mosteo" writes: > > >>This is something I don't fully understand. IFAIK, >> >>procedure Proc (Blah : access Some_Type); >> >>access parameters raise an excepcion if null. So I don't get what adds >>to the language the >> >>Blah : not null access ... >> >>construct. > > > When using the "not null" access type, it is the responsibility of the > caller to ensure that the parameter value is not null. This way the > compiler can optimise away checks for a null value in the subprogram > in question ("Proc" in your case) > > Note that it is still the run-time system (and not the programmer), > that performs the check, but it is only done once - before calling the > subprogram. Often the check can be optimised away. Thanks for the explanation.