From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: not null access procedure (was: Re: Dynamic String)
Date: 01 Nov 2005 20:07:47 -0500
Date: 2005-11-01T20:07:47-05:00 [thread overview]
Message-ID: <wcchdavluvw.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: slrndmg9d1.bmv.bogus_addy@tango.mindfuq.org
Anonymous Coward <bogus_addy@bogus_domain.net> 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
next prev parent reply other threads:[~2005-11-02 1:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-22 15:16 Dynamic String TC
2005-10-22 17:10 ` jimmaureenrogers
2005-10-22 21:03 ` Jeffrey R. Carter
2005-10-22 21:51 ` Adrian Knoth
2005-10-26 14:04 ` Martin Krischik
2005-10-31 10:15 ` Harald Korneliussen
2005-10-31 12:05 ` Larry Kilgallen
2005-11-01 8:02 ` Harald Korneliussen
2005-11-01 10:55 ` Pascal Obry
2005-11-01 17:20 ` Martin Dowie
2005-11-01 20:09 ` Matthew Heaney
2005-11-02 0:34 ` not null access procedure (was: Re: Dynamic String) Anonymous Coward
2005-11-02 1:07 ` Robert A Duff [this message]
2005-11-02 8:10 ` not null access procedure Dmitry A. Kazakov
2005-11-01 22:31 ` Dynamic String Björn Persson
2005-11-02 10:56 ` Stefan Bellon
2005-11-02 0:18 ` Stephen Leake
2005-11-02 7:31 ` Harald Korneliussen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox