From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: How many Ada compiler bugs are here?
Date: Fri, 13 Jan 2012 13:43:40 +0100
Date: 2012-01-13T13:43:41+01:00 [thread overview]
Message-ID: <4f1026fd$0$6574$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <xvj2f2yki9lk$.jv0y5dm4p76g$.dlg@40tude.net>
On 13.01.12 12:39, Dmitry A. Kazakov wrote:
> On 13 Jan 2012 10:38:04 GMT, georg bauhaus wrote:
>
>> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote:
>>
>>>
>>> package P is
>>> type T (<>) is private;
>>> private
>>> type T is new Integer;
>>> end P;
>>>
>>
>> package P.Dummies is
>> Meaningless_Dummy : constant T;
>> Raising_Dummy : constant T;
>> private
>> ...
>> End P.Dummies;
>
> Which of course defies the very idea of requiring T initialized. If there
> exist some Meaningless_Dummy constant, then that could serve as an initial
> value for T.
I'd drop Meaningless_Dummy, then, and declare only the dummy
that raises an exception:
package P is
type T (<>) is private;
private
type T is new Integer;
function Raises_Assertion_Error return T;
end P;
package P.Dummies is
Raising_Dummy : constant T;
private
Raising_Dummy : constant T := Raises_Assertion_Error;
end P.Dummies;
-- or make Raising_Dummy a constructing function that raises,
-- so that raising happens where Raising_Dummy is written.
with Ada.Assertions;
package body P is
function Raises_Assertion_Error return T is
use Ada.Assertions;
begin
raise Assertion_Error with "FIXME";
return Raises_Assertion_Error;
end Raises_Assertion_Error;
end P;
Is this about statically ascertaining that a meaningful initial value
has been stored in an object of type T, where "meaningful" is a statically
known consequence of using some construction feature of non-Ada, or
not-yet-Ada?
next prev parent reply other threads:[~2012-01-13 12:43 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 23:20 How many Ada compiler bugs are here? Maciej Sobczak
2012-01-13 0:21 ` Randy Brukardt
2012-01-13 1:26 ` Adam Beneschan
2012-01-13 8:23 ` Dmitry A. Kazakov
2012-01-13 8:47 ` AdaMagica
2012-01-13 9:07 ` Dmitry A. Kazakov
2012-01-13 9:35 ` AdaMagica
2012-01-13 10:00 ` Dmitry A. Kazakov
2012-01-13 10:38 ` georg bauhaus
2012-01-13 11:39 ` Dmitry A. Kazakov
2012-01-13 12:43 ` Georg Bauhaus [this message]
2012-01-13 13:06 ` AdaMagica
2012-01-13 13:16 ` AdaMagica
2012-01-13 13:22 ` Georg Bauhaus
2012-01-13 13:29 ` Dmitry A. Kazakov
2012-01-13 10:52 ` AdaMagica
2012-01-13 11:35 ` Dmitry A. Kazakov
2012-01-13 12:58 ` AdaMagica
2012-01-13 13:43 ` Dmitry A. Kazakov
2012-01-13 15:06 ` Robert A Duff
2012-01-13 15:46 ` Dmitry A. Kazakov
2012-01-13 17:42 ` georg bauhaus
2012-01-13 18:52 ` Dmitry A. Kazakov
2012-01-14 0:26 ` Randy Brukardt
2012-01-14 9:49 ` Dmitry A. Kazakov
2012-01-19 1:35 ` Randy Brukardt
2012-01-19 10:33 ` Dmitry A. Kazakov
2012-01-14 2:41 ` Robert A Duff
2012-01-13 17:23 ` Adam Beneschan
2012-01-14 2:41 ` Robert A Duff
2012-01-13 17:15 ` Adam Beneschan
2012-01-13 20:06 ` Blady
2012-01-13 23:30 ` Adam Beneschan
2012-01-14 13:29 ` Brian Drummond
2012-01-19 1:47 ` Randy Brukardt
2012-01-19 4:24 ` Adam Beneschan
2012-01-20 0:04 ` Randy Brukardt
2012-01-14 10:20 ` Maciej Sobczak
2012-01-14 14:03 ` Brian Drummond
2012-01-16 16:35 ` Adam Beneschan
2012-01-20 10:43 ` Brian Drummond
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox