Re: Tasking and wxWidgets
- From: "Randy Brukardt" <randy@xxxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 15:46:00 -0600
"Martin Dowie" <martin.dowie@xxxxxxxxxxxxxx> wrote in message
news:438c19c5_1@xxxxxxxxxxxxxxxxxxxxxxxxx
> Randy Brukardt wrote:
> > "Martin Dowie" <martin.dowie@xxxxxxxxxxxxxxx> wrote in message
> > news:dma971$fvc$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> >> 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.
.
- Follow-Ups:
- Re: Tasking and wxWidgets
- From: Martin Dowie
- Re: Tasking and wxWidgets
- References:
- Tasking and wxWidgets
- From: Lucretia
- Re: Tasking and wxWidgets
- From: Martin Dowie
- Re: Tasking and wxWidgets
- From: Lucretia
- Re: Tasking and wxWidgets
- From: Martin Dowie
- Re: Tasking and wxWidgets
- From: Randy Brukardt
- Re: Tasking and wxWidgets
- From: Martin Dowie
- Tasking and wxWidgets
- Prev by Date: Re: Tasking and wxWidgets
- Next by Date: Re: Silly question about strings (was: Filenames in Ada)
- Previous by thread: Re: Tasking and wxWidgets
- Next by thread: Re: Tasking and wxWidgets
- Index(es):