comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Default expression only allowed for "in" parameters - why?
Date: Fri, 6 Apr 2001 21:49:16 GMT
Date: 2001-04-06T21:49:16+00:00	[thread overview]
Message-ID: <wccvgohvgv7.fsf@world.std.com> (raw)
In-Reply-To: 9al9mc$jgk2@cui1.lmms.lmco.com

"Smark" <not.provided@all.com> writes:

> procedure Do_Something (Data   : in Some_Type;
>                         Status : out Status_Type := Ok);
> 
> It also seemed like a strange idea, because I never recalled seeing
> it done.  Sure enough, it is prohibited by the LRM.  What is the
> rationale for this?

If defaults were allowed for 'out' params, I would think it ought to
mean that this is the default variable to pass to the parameter, not a
default initial value for it.  In Ada, a default applies if the
parameter is not explicitly given at the call site.  Are you saying that
Status should be initialized to OK if the actual parameter is specified?

Defaults for 'out' params were allowed in Green.  I don't know why they
were removed.  Perhaps the fact the you and I disagree on what they
ought to mean is a hint.

- Bob



  parent reply	other threads:[~2001-04-06 21:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-06 20:41 Default expression only allowed for "in" parameters - why? Smark
2001-04-06 21:30 ` Corey Ashford
2001-04-06 21:49 ` Robert A Duff [this message]
2001-04-07  4:19   ` Ben Brosgol
2001-04-09 14:42     ` Marin David Condic
2001-04-09 15:08   ` Smark
2001-04-10 13:59     ` Martin Dowie
2001-04-07 14:12 ` Charles H. Sampson
2001-04-07 18:17   ` Ben Brosgol
2001-04-09 14:07 ` Marin David Condic
replies disabled

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