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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,33fc00a6ce6be410 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: not null access procedure (was: Re: Dynamic String) Date: 01 Nov 2005 20:07:47 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1130753721.639869.322210@g43g2000cwa.googlegroups.com> <1130832161.671656.88230@o13g2000cwo.googlegroups.com> <1130875772.717413.45520@g14g2000cwa.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1130893667 1132 192.74.137.71 (2 Nov 2005 01:07:47 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 2 Nov 2005 01:07:47 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:6103 Date: 2005-11-01T20:07:47-05:00 List-Id: Anonymous Coward writes: > In article <1130875772.717413.45520@g14g2000cwa.googlegroups.com>, Matthew Heaney wrote: > > > > Ada 2005 will indeed include a standard container library. You can > > find the latest AI-302 draft (released just a couple of days ago) > > here: > > > > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-20302.TXT?rev=1.23 > > I noticed some syntax in the package specification of that link above, > which is unfamiliar to me: > > procedure Update_Element > (Container : in out Vector; > Index : in Index_Type; > Process : not null access procedure (Element : in out Element_Type)); > > What is meant by this "not null"? Is this available in ADA95, or new > to ADA05? New to Ada 2005. "Not null" means there's a run-time check that the pointer is not null. It's pretty annoying that in order to pass a procedure as a parameter, you have to say the noise words "not null access", but that was considered necessary for compatibility. > I also had a more general question with access procedures. Does an > access procedure still have scope in the package it is defined in? > Will it be able to access other subprograms and variables that it > normally would, when it is executed by the container package, > considering the container package has no visibility into its user? Yes. This is the "downward closure" feature that we've all been waiting for. - Bob