comp.lang.ada
 help / color / mirror / Atom feed
From: johnherro@aol.com
Subject: Re: type declaration problem(beginner)
Date: 1997/03/03
Date: 1997-03-03T00:00:00+00:00	[thread overview]
Message-ID: <19970303181200.NAA21239@ladder02.news.aol.com> (raw)
In-Reply-To: 1997Feb26.120011.27@whisky


I wrote:
>> type Set_Type is array(Month) of Boolean; ...
>> Short_Months : Set_Type := Set_Type'(Feb|Apr|Jun|Sep|Nov => True,
others => False);
Robert Dewar wrote:
> there is no point in putting in unnecessary
> qualifications, and this one is unnecessary...
> Write the qualification only if it helps readability
> (in the quoted case, it clearly does NOT do so)
     Robert is right, of course.  The rules about when qualification was necessary when "others" followed named notation were quite complicated in Ada 83, and as I teacher I recommended that students always qualify the aggregate in such cases, rather than learn the complex rules.  For example, after a "return" statement in a function, such qualification was unnecessary, but in the above example, the qualification *was* necessary in Ada 83.  In Ada 95 the rules regarding this are simpler.  Assuming the original poster, Scott Dawkins, is using an Ada 95 compiler (and that's the assumption here in comp.lang.ada unless the poster says otherwise), the qualification, although accepted by the compiler, is unnecessary.
- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor




  parent reply	other threads:[~1997-03-03  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-26  0:00 type declaration problem(beginner) dawkins
1997-03-02  0:00 ` johnherro
1997-03-02  0:00   ` Robert Dewar
1997-03-03  0:00 ` johnherro [this message]
1997-03-05  0:00 ` David Wheeler
replies disabled

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