From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Build-in-place semantics? (Was: Ada design bug or GNAT bug?)
Date: Sat, 4 Jul 2015 19:40:21 -0500
Date: 2015-07-04T19:40:21-05:00 [thread overview]
Message-ID: <mn9udm$utg$1@loke.gir.dk> (raw)
In-Reply-To: 87bnfsfanx.fsf_-_@adaheads.sparre-andersen.dk
Jacob Sparre Andersen" <sparre@nbi.dk> wrote in message
news:87bnfsfanx.fsf_-_@adaheads.sparre-andersen.dk...
> Randy Brukardt wrote:
>
>> Probably not, build-in-place semantics isn't practical for all
>> non-limited types (think normal assignment, can't build-in-place
>> because if an exception occurs the original value has to be intact).
>
> A very sensible requirement, but wouldn't it be nice ...
>
> I suppose that compilers are allowed to use build-in-place when
> initialising non-limited objects? (But that would of course in practice
> mean that you had two different compiled versions of every function.)
Yes, of course. It's not possible to write a program that can tell the
difference. (Code inspection could tell, of course, but that's considered
cheating - any code that gives the required semantics should be OK.)
One could avoid the assignment problem by introducing a temporary in just
such cases, but that's essentially the same as not using build-in-place in
the first place. One also could arrange to just use build-in-place for types
that don't have the exception-on-assignment possibility (there are plenty of
those).
Randy.
next prev parent reply other threads:[~2015-07-05 0:40 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 18:55 Ada design bug or GNAT bug? Dmitry A. Kazakov
2015-06-21 2:42 ` Randy Brukardt
2015-06-21 6:47 ` Dmitry A. Kazakov
2015-06-22 17:39 ` Randy Brukardt
2015-06-22 18:16 ` Dmitry A. Kazakov
2015-06-23 11:00 ` G.B.
2015-06-23 14:27 ` Dmitry A. Kazakov
2015-06-23 11:45 ` G.B.
2015-06-23 14:30 ` Dmitry A. Kazakov
2015-07-02 22:22 ` Randy Brukardt
2015-07-03 8:02 ` Dmitry A. Kazakov
2015-07-03 17:33 ` Randy Brukardt
2015-07-03 21:34 ` Dmitry A. Kazakov
2015-07-04 3:11 ` Randy Brukardt
2015-07-04 12:14 ` Dmitry A. Kazakov
2015-07-05 0:53 ` Randy Brukardt
2015-06-22 18:27 ` Shark8
2015-06-23 11:51 ` vincent.diemunsch
2015-06-23 19:55 ` Shark8
2015-06-23 13:06 ` vincent.diemunsch
2015-06-23 14:30 ` David Botton
2015-06-23 15:57 ` Niklas Holsti
2015-06-23 16:01 ` G.B.
2015-06-23 18:05 ` David Botton
2015-06-23 19:38 ` David Botton
2015-06-23 14:38 ` Dmitry A. Kazakov
2015-06-23 16:57 ` Vincent
2015-06-23 17:15 ` Dmitry A. Kazakov
2015-06-23 19:14 ` vincent.diemunsch
2015-06-23 19:33 ` Dmitry A. Kazakov
2015-06-23 17:42 ` Jeffrey R. Carter
2015-07-02 22:06 ` Randy Brukardt
2015-07-04 1:52 ` Shark8
2015-07-04 3:24 ` Randy Brukardt
2015-07-04 11:02 ` Build-in-place semantics? (Was: Ada design bug or GNAT bug?) Jacob Sparre Andersen
2015-07-04 12:15 ` Dmitry A. Kazakov
2015-07-05 0:45 ` Randy Brukardt
2015-07-05 7:10 ` Dmitry A. Kazakov
2015-07-05 0:40 ` Randy Brukardt [this message]
2015-07-04 14:05 ` Ada design bug or GNAT bug? Bob Duff
2015-07-04 7:46 ` Simon Wright
2015-07-04 12:00 ` Björn Lundin
2015-07-05 0:48 ` Randy Brukardt
2015-07-06 12:37 ` Vincent
2015-07-06 20:05 ` Randy Brukardt
2015-07-07 8:06 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox