comp.lang.ada
 help / color / mirror / Atom feed
From: martinbbjerregaard@gmail.com
Subject: Re: Mutating elements of constant list using a container element iterator
Date: Wed, 5 Aug 2015 04:35:25 -0700 (PDT)
Date: 2015-08-05T04:35:25-07:00	[thread overview]
Message-ID: <8a2d154b-cdaf-4a44-856c-a86dcb4d5bba@googlegroups.com> (raw)
In-Reply-To: <0c1904af-8ede-4694-a50a-ac9f60d7dc63@googlegroups.com>

Egil H H writes:
> Gnat Pro 7.3.1 reports "left hand side of assignment must be a variable" here.

That is strange. I'm using GNAT GPL 2015 (20150428-49), so I'm going to assume that it is a bug then.

Jacob Sparre Andersen writes:
> The trick is to assign a new value to the whole object, and not just a
> component of it:
> 
>    for Item of V2 loop
>       Item := (Value => 0);
>    end loop;
> 
> I'm not sure exactly why there is a difference.

for Item of V1 loop
   Item := (Value => 0); -- still no error
end loop;

This still gives no error, even though V1 is declared as constant.


  parent reply	other threads:[~2015-08-05 11:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 23:56 Mutating elements of constant list using a container element iterator martinbbjerregaard
2015-08-05  7:32 ` Egil H H
2015-08-05 11:23   ` martinbbjerregaard
2015-08-05  7:43 ` Jacob Sparre Andersen
2015-08-05 11:35 ` martinbbjerregaard [this message]
2015-08-06 19:02 ` Randy Brukardt
replies disabled

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