From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Map iteration and modification Date: Sun, 7 Jan 2024 16:06:10 +0100 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 7 Jan 2024 15:06:10 -0000 (UTC) Injection-Info: dont-email.me; posting-host="6f06c247f9ecf9851466c45652f7cf9c"; logging-data="1145339"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bu5d4HuDvhJXDFk9O+hR58A92Co2iu0o=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:GxvFGFvzib0Y+NPW0S5dzZtBEIE= Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65970 List-Id: On 2024-01-06 08:25, Randy Brukardt wrote: > > @ is regular in the sense that it is allowed anywhere in an expression. If > you tried to expand the use to other contexts, you would have to > differentiate them, which would almost certainly require some sort of > declaration. But doing that risks making the mechanism as wordy as what it > replaces (which obviously defeats the purpose). > > We looked at a number of ideas like that, but they didn't seem to help > comprehension. In something like: > LHS:(X(Y)) := LHS + 1; > (where LHS is an arbitrary identifier), if the target name is fairly long, > it could be hard to find where the name for the target is given, and in any > case, it adds to the name space that the programmer has to remember when > reading the source expression. That didn't seem to add to readability as > much as the simple @ does. > > In any case, these things are trade-offs, and certainly nothing is absolute. > But @ is certainly much more general than ":=+" would be, given that it > works with function calls and array indexing and attributes and user-defined > operations rather than just a single operator. For the 9X and 0X revisions I suggested adding "when " to return and raise statements, similar to its use on exit statements. This was rejected because the language already has a way to accomplish this: if statements. Given that one can do declare V : T renames Very_Long_Identifier; begin V := V - 23; end; it seems that @ should also have been rejected. Probably more so, since @ is completely new syntax rather than reusing existing syntax on some additional statements. What is the justification of accepting @ while still rejecting the other? -- Jeff Carter "If I could find a sheriff who so offends the citizens of Rock Ridge that his very appearance would drive them out of town ... but where would I find such a man? Why am I asking you?" Blazing Saddles 37