comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: MI is sloppy
Date: Fri, 12 Dec 2008 11:50:43 +0100
Date: 2008-12-12T11:50:43+01:00	[thread overview]
Message-ID: <49424203$0$31868$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <1hjx0k7xmfw4n$.14q7chpo1r1ma$.dlg@40tude.net>

Dmitry A. Kazakov schrieb:
> On Thu, 11 Dec 2008 15:44:30 -0600, Randy Brukardt wrote:

>>> Whatever way you go, incrementally adding operations or else incrementally
>>> removing them.
>> No, that's not what I meant. I meant something like:
>>
>> type File is ...
>> subtype Inout_File is ...
>> subtype In_File is ...
>> subtype Out_File is ...
>> procedure Get (A_File : in out File; Item : out Data)
>> with precondition A_File not in In_File;
>> procedure Put (A_File : in out File; Item : Data)
>> with precondition A_File not in Out_File;
> 
> To me it is exactly same. The precondition not to be in a subtype is
> equivalent to disallowing the operations specific to that subtype. Unless
> precondition is treated as a constraint check with Constraint_Error
> propagated. In the latter case Get is merely an overriding by the body
> 
> begin
>    raise Constraint_Error;
> end;
> 
> Not very exciting to me.

If you have an ambitious compiler, it might reach out,
at compile time, for objects whose behavior is then known
to be constrained by membership in a then known specific
subtype.



  reply	other threads:[~2008-12-12 10:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-06 10:09 MI is sloppy (was: Construction initialization problem) Dmitry A. Kazakov
2008-12-06 17:16 ` Georg Bauhaus
2008-12-06 21:16   ` Martin Krischik
2008-12-06 21:35     ` Maciej Sobczak
2008-12-07  9:12   ` MI is sloppy Dmitry A. Kazakov
2008-12-07 15:38     ` Georg Bauhaus
2008-12-07 20:04       ` Dmitry A. Kazakov
2008-12-11  0:40 ` MI is sloppy (was: Construction initialization problem) Randy Brukardt
2008-12-11 10:02   ` MI is sloppy Dmitry A. Kazakov
2008-12-11 21:44     ` Randy Brukardt
2008-12-11 23:17       ` Georg Bauhaus
2008-12-12 10:06         ` Dmitry A. Kazakov
2008-12-12  9:59       ` Dmitry A. Kazakov
2008-12-12 10:50         ` Georg Bauhaus [this message]
2008-12-12 11:15           ` Dmitry A. Kazakov
2008-12-12 12:15             ` Georg Bauhaus
2008-12-12 13:35               ` Dmitry A. Kazakov
2008-12-12 14:29                 ` Georg Bauhaus
2008-12-12 14:59                   ` Dmitry A. Kazakov
2008-12-13  0:08                 ` Randy Brukardt
2008-12-13  9:54                   ` 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