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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9625801f07d834 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-09 07:26:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!isdnet!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Default expression only allowed for "in" parameters - why? Date: Mon, 9 Apr 2001 10:07:18 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9asfmn$phu$1@nh.pace.co.uk> References: <9al9mc$jgk2@cui1.lmms.lmco.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 986825239 26174 136.170.200.133 (9 Apr 2001 14:07:19 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 9 Apr 2001 14:07:19 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: supernews.google.com comp.lang.ada:6659 Date: 2001-04-09T14:07:19+00:00 List-Id: The rationale AFAIK probably had to do with the fact that one could treat an in parameter as a constant and provide constants or function calls as actuals. With out or in-out, you've got to provide a variable so there seemed to be less justification for default values. IMHO, since you can define some kind of legitimate, predictable behavior for in-out and out parameters with a default value, it probably should have been done just for orthogonality. I've run into situations where it would have been useful to have. There may be some technical reason for having left it out, but offhand I can't think of one. MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Smark" wrote in message news:9al9mc$jgk2@cui1.lmms.lmco.com... > LRM 6.1(19): > A default_expression is only allowed in a parameter_specification > for a formal parameter of mode in. > > I recently had a situation in which it was desirable for me to have > a default value for an "out" parameter of a function. It was something > like: > > procedure Do_Something (Data : in Some_Type; > Status : out Status_Type); > > Normally, Status = Ok. It seemed to me that, rather than setting > Status := Ok at the beginning of my procedure, it would make sense to > just set the default value in the procedure spec. That is: > > 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? > > TIA, > Mark > >