comp.lang.ada
 help / color / mirror / Atom feed
From: gamache@rapnet.sanders.lockheed.com
Subject: Re: Ada can't initialize (aggregate) array of length 1?
Date: 16 Dec 94 08:34:52 -500
Date: 1994-12-16T08:34:52-05:00	[thread overview]
Message-ID: <1994Dec16.083452.1@rapnet.sanders.lockheed.com> (raw)
In-Reply-To: 3chim1$6v5@gamma.ois.com

In article <3chim1$6v5@gamma.ois.com>, beckwb@ois.com (R. William Beckwith) writes:
> Dirk Zoller (duz@roxi.rz.fht-mannheim.de) wrote:
> 
> :     type stone is array (1..2) of character;
> :     shapes: constant array (1..1) of stone := ("[]");
> 
> Try:
>       shapes: constant array (1..1) of stone := (others => "[]");
> 
> ... Bill

This solution, or
	
	shapes : constant array (1..1) of stone := (1=> "[]");

is/are the correct one.  But I thought your real question was, why doesn't
positional notation work for aggregates of length 1?

I had no idea and was curious myself, so I stuck your example into our
compiler which promptly pointed me to paragraph 4 of the "old" Ada LRM.

It says:

... Aggregates containing a single component association must always
    be given in named notation.

Apparently this was carried into Ada95 as well. 
Thanks for bringing up a new (to me at least) part of Ada.

Joe



  reply	other threads:[~1994-12-16 13:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-12  7:12 Ada can't initialize (aggregate) array of length 1? Dirk Zoller
1994-12-12 12:54 ` Gentle
1994-12-12 18:35   ` Bob Duff
1994-12-13 17:01   ` Jahn Rentmeister
1994-12-14  3:23   ` Robert Dewar
1994-12-12 13:20 ` R. William Beckwith
1994-12-16 13:34   ` gamache [this message]
1994-12-14  3:21 ` Robert Dewar
1994-12-16 10:37   ` Dirk Zoller
1994-12-19 14:20     ` Robert Dewar
1994-12-16 16:41   ` Scott Leschke
1994-12-17 17:52     ` Robert Dewar
replies disabled

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