comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Tasking and wxWidgets
Date: Tue, 29 Nov 2005 15:46:00 -0600
Date: 2005-11-29T15:46:00-06:00	[thread overview]
Message-ID: <KsWdna7irpa_VhHeRVn-rQ@megapath.net> (raw)
In-Reply-To: 438c19c5_1@glkas0286.greenlnk.net

"Martin Dowie" <martin.dowie@baesystems.com> wrote in message
news:438c19c5_1@glkas0286.greenlnk.net...
> Randy Brukardt wrote:
> > "Martin Dowie" <martin.dowie@btopenworld.com> wrote in message
> > news:dma971$fvc$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
> >> You won't need a preprocessor (although GNAT does have one
> >> 'gnatprep') - same spec, different bodies.
> >>
> >> -- Spec
> >> procedure Foo;
> >>
> >> -- Body
> >> procedure Foo is null;
> >
> > While it's not germane to Martin's point, this code is illegal in Ada
> > 200Y: a null procedure cannot be a completion. Why not? Null
> > procedures are similar to abstract subprograms in use and
> > description, and those clearly can't be a completion. And it didn't
> > seem worth a new bunch of rules to avoid typing 12 characters - the
> > least important savings that one could imagine.
>
> So we're stuck with "procedure Foo is begin null; end;" and a "pragma
> Inline"?

I don't get it. The body of "is null" would have the same meaning as "is
begin null; end;", so an Inline pragma would be necessary anyway. The only
difference would be 11 less characters to type.

If you wanted to get rid of the Inline pragma, you'd have to put "is null"
into the specification (which of course is the entire point of the "is null"
feature anyway).

> To me a null completion would be _very_ useful where you have different
> package bodies for different targets but want to share a common package
> spec.

Yes, but that's already possible with "begin null; end;". You seem to be
imagining semantics that wouldn't exist. It would be very unusual for an "is
null" completion to imply some sort of body dependence. Even renames-as-body
are potentially implemented as automatically generated subprogram bodies
(meaning that you need a pragma Inline to prevent that). Ada is very
consistent about requiring only the specification of a subprogram in order
to determine how it can be called (and code generated for it).

                     Randy.






  reply	other threads:[~2005-11-29 21:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-25 10:05 Tasking and wxWidgets Lucretia
2005-11-25 10:53 ` Martin Dowie
2005-11-26 17:32   ` Lucretia
2005-11-26 18:23     ` Martin Dowie
2005-11-29  3:07       ` Randy Brukardt
2005-11-29  9:13         ` Martin Dowie
2005-11-29 21:46           ` Randy Brukardt [this message]
2005-11-29 22:46             ` Martin Dowie
2005-11-25 11:37 ` Dmitry A. Kazakov
2005-11-26 17:26   ` Lucretia
2005-11-27 11:15     ` Dmitry A. Kazakov
2005-11-28 10:48       ` Lucretia
2005-11-28 14:41         ` Dmitry A. Kazakov
2005-11-26 17:26   ` Lucretia
2005-11-26 17:28   ` Lucretia
2005-11-26 17:34   ` Lucretia
2005-11-26  7:46 ` Simon Wright
2005-11-28 10:37   ` Lucretia
2005-11-29 21:38     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox