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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Mutating elements of constant list using a container element iterator Date: Wed, 05 Aug 2015 09:43:49 +0200 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: <87vbcuyybu.fsf@adaheads.sparre-andersen.dk> References: <0c1904af-8ede-4694-a50a-ac9f60d7dc63@googlegroups.com> NNTP-Posting-Host: 195.249.206.131 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: loke.gir.dk 1438760629 25977 195.249.206.131 (5 Aug 2015 07:43:49 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 5 Aug 2015 07:43:49 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:EEsfl6l95P6hQUpBZm/pBR6D5xo= Xref: news.eternal-september.org comp.lang.ada:27363 Date: 2015-08-05T09:43:49+02:00 List-Id: martinbbjerregaard@gmail.com writes: > Mutating elements of a constant container in a "for ... of ... loop" > is possible with the "standard" container types but not the indefinite > or bounded containers: 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. > Is this a bug? It might be. I don't understand the indefinite containers well enough to be able to explain what happens. Greetings, Jacob -- "The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself?"