From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP>
Subject: Re: Comments requested for a couple of Ada-Comments submissions
Date: Fri, 11 Jul 2014 20:02:08 +0000 (UTC)
Date: 2014-07-11T20:02:08+00:00 [thread overview]
Message-ID: <lppfs0$v0b$1@dont-email.me> (raw)
In-Reply-To: c2ag8cFi21iU1@mid.individual.net
On 2014-07-11, Niklas Holsti <niklas.holsti@tidorum.invalid> wrote:
> On 14-07-11 07:16 , Randy Brukardt wrote:
>> "Jeffrey Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message
>> news:lpnb74$kmi$1@dont-email.me...
>> ...
>>> I don't see that there is anything here that the ARG would want to take
>>> action on, especially given that Randy said they're only interested in
>>> things that are hard or impossible to do in Ada. This is clearly not hard
>>> or impossible.
>>
>> Well, actually, I understand that a similar problem came up recently (I
>> think it was related to SPARK) and that the GNAT people had already hacked
>> an ugly solution to it. A language-based solution would be better, at least
>> if it's not too expensive to implement.
>>
>> After all, two independent problems that can be solved with a relatively
>> simple new feature make that feature more compelling. In any case, it's
>> certainly OK for Simon to submit the problem; I've seen a lot sillier ideas
>> than this one.
>>
>> Randy.
>
> Thanks, Simon, for working up this proposal.
>
You are welcome.
> I think that this proposal should not be limited to solving the "update
> of atomic" problem. The ability to write an aggregate that generates a
> composite value by giving new values for just some of the components of
> an existing composite value is quite useful in any context where a
> composite value is used.
>
That is a very good point. I will add wording that makes it clear the
exact same syntax could be used for general updating of, say, records
in general.
It does raise another point, however. So far, I have only thought about
non-discriminated records due to my focus on device registers. Are
there any additional issues when discriminated records are involved ?
It's only occurred to me just now while typing up this response, but
I can't see how it could possibly make a difference, even with
variant records.
However, I just thought I would ask the question anyway. :-)
>
> Furthermore, the proposal should IMO not be limited to record types. The
> same should be possible for array aggregates, as in this example:
>
> type Month_Days is array (Month) of Positive;
>
> Normal_Year_Days : constant Month_Days :=
> (Jan => 31, Feb => 28, Mar => 31, ..., Dec => 31);
>
> Leap_Year_Days : constant Month_Days :=
> (Normal_Year_Days changing Feb => 29);
>
I can see what you are saying here. Let me have a think about it. :-)
Simon.
--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
next prev parent reply other threads:[~2014-07-11 20:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-11 0:02 Comments requested for a couple of Ada-Comments submissions Simon Clubley
2014-07-11 0:30 ` Jeffrey Carter
2014-07-11 4:16 ` Randy Brukardt
2014-07-11 16:04 ` Niklas Holsti
2014-07-11 16:24 ` Dan'l Miller
2014-07-11 20:02 ` Simon Clubley [this message]
2014-07-12 5:52 ` Niklas Holsti
2014-07-11 4:26 ` Randy Brukardt
2014-07-11 7:05 ` Simon Clubley
2014-07-11 4:56 ` Shark8
2014-07-11 15:35 ` Adam Beneschan
2014-07-11 17:26 ` Niklas Holsti
2014-07-11 17:55 ` Adam Beneschan
2014-07-11 18:00 ` Simon Wright
2014-07-11 19:07 ` Georg Bauhaus
2014-07-11 19:10 ` Dmitry A. Kazakov
2014-07-11 19:16 ` Niklas Holsti
2014-07-11 19:35 ` Dmitry A. Kazakov
2014-07-11 21:24 ` Randy Brukardt
2014-07-11 21:46 ` Shark8
2014-07-11 19:30 ` Simon Clubley
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox