comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: On pragma Precondition etc.
Date: Tue, 29 Jul 2008 14:08:50 +0200
Date: 2008-07-29T14:08:50+02:00	[thread overview]
Message-ID: <py8uf7h03ctg$.qp3cvq1pos4a$.dlg@40tude.net> (raw)
In-Reply-To: 488efc8d$1@news.post.ch

On Tue, 29 Jul 2008 13:18:37 +0200, Martin Krischik wrote:

> It too think a dedicated syntax would be best.

Agree.

> However, I suggest to 
> take a good look at task and protected types for guidance.

No. Barriers are invisible implementation details. Pre-/post-conditions
describe the contract.

> Protected types already have an precondition. I know they are attached 
> to the body and a protected type blocks until the condition becomes true.

Barrier expression is not a precondition (nor a post-condition, nor an
invariant).

> But the idea behind is still similar and so should be the syntax.

No, the syntax should be bound to the parameter types. Georg already
mentioned the inheritance issue. It is a very (probably the most) important
point, because contracts are subject to inheritance.

The problem with this is that the conditions are traditionally considered
in a more loose, untyped context. Their expressions involve all parameters.
In fact it means that they are bound to the anonymous type of the type of
subprogram parameters. This makes the issue of inheritance quite difficult,
especially, because inheritance on tuples of types is basically equivalent
multiple-dispatch. So...

> And how about Invariants (http://en.wikipedia.org/wiki/Class_invariant)?

Same problems. Syntax issues are inferior, IMO. But I agree, no more new
keywords, please! (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2008-07-29 12:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25  8:01 On pragma Precondition etc Georg Bauhaus
2008-07-25 10:50 ` stefan-lucks
2008-07-25 11:05   ` mockturtle
2008-07-25 11:44     ` Alex R. Mosteo
2008-07-25 11:56       ` Georg Bauhaus
2008-07-28  8:02         ` Alex R. Mosteo
2008-07-29 11:18       ` Martin Krischik
2008-07-29 12:08         ` Dmitry A. Kazakov [this message]
2008-07-29 14:19           ` Georg Bauhaus
2008-07-29 14:49             ` Georg Bauhaus
2008-07-29 15:00             ` Dmitry A. Kazakov
2008-07-29 15:14               ` Georg Bauhaus
2008-07-29 15:55               ` Georg Bauhaus
2008-07-29 17:49                 ` Dmitry A. Kazakov
2008-07-30  9:06                   ` Georg Bauhaus
2008-07-30 13:47                     ` Dmitry A. Kazakov
2008-07-30 17:45                       ` Georg Bauhaus
2008-07-31  8:12                         ` Dmitry A. Kazakov
2008-07-31 23:06                           ` Georg Bauhaus
2008-08-01  8:40                             ` Dmitry A. Kazakov
2008-07-30  9:22                   ` Georg Bauhaus
2008-07-30 13:56                     ` Dmitry A. Kazakov
2008-07-25 14:39   ` Robert A Duff
2008-07-25 16:50 ` Pascal Obry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox