comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Ada vs Eiffel - Ada programmer approach
Date: Thu, 4 Jun 2009 00:55:17 -0700 (PDT)
Date: 2009-06-04T00:55:17-07:00	[thread overview]
Message-ID: <88f38fe3-01ec-407f-b7b6-84a1d10de7f1@h11g2000yqb.googlegroups.com> (raw)
In-Reply-To: a924d96e-17b8-4573-ae86-3ccc924d21c8@x6g2000vbg.googlegroups.com

On Jun 4, 9:30 am, Hibou57 (Yannick Duchêne)
<yannick_duch...@yahoo.fr> wrote:
> On 26 mai, 15:37, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
>
> > [...] Ada's pragma Assert provides what I
> > need in these (rare) cases  because I can put such pragmas in the
> > middle of a subprogram, for example.
>
> > --
> > Ludovic Brenta.
>
> This is not the same as Eiffel assertions. Eiffel's assertions are
> aware of the invokation contexte. Let say you have a class C and a
> method M and the class C has an invariant I. Then, if a client invoks
> M, the invariant will be checked before M returns. That's Ok, this is
> the same as with "in code assertions". But if M is invoked by anoher
> method of the class, i.e. as an implementation method (this is very
> common to use a public method for internal purpose), you will have
> this : the client of C invok a method M2 which in turn will invok M
> (the client may or may not know about it). In this context, the class
> invariant will obviously be checked before returning from M2, but *it
> will not be check before return from M*.
>
> That is beceause M is allowed to left the class invariant in an
> illegal state, as it may be the sole responsability of M2.
>
> So, Eiffel's assertions are not the same as "in code assertions".
> Eiffel's assertions are well formalized.

I think my point was precisely that Ada assertions were different from
Eiffel's. I like the fact that, in Ada, I can place assertions in the
middle of a complex subprogram; this is not possible Eiffel, as you
aptly described. I agree that Eiffel's assertions are well-defined but
my argument is that they are less useful and more diffucult to use in
practice than the beauty of the design suggests.

--
Ludovic Brenta.



  reply	other threads:[~2009-06-04  7:55 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24  8:39 Ada vs Eiffel - Ada programmer approach Tomek Walkuski
2009-05-24 11:49 ` anon
2009-05-24 12:26   ` Georg Bauhaus
2009-05-24 12:17 ` Georg Bauhaus
2009-05-24 16:31 ` Pascal Obry
2009-05-25 16:32   ` Rugxulo
2009-05-26 13:37   ` Ludovic Brenta
2009-05-26 14:51     ` Dmitry A. Kazakov
2009-05-26 17:26       ` Georg Bauhaus
2009-05-26 17:39         ` Dmitry A. Kazakov
2009-05-26 17:59           ` Georg Bauhaus
2009-05-26 19:52             ` Dmitry A. Kazakov
2009-05-26 20:14               ` Pascal Obry
2009-05-26 20:25                 ` Pascal Obry
2009-05-26 21:28                 ` Dmitry A. Kazakov
2009-05-26 18:23       ` Jeffrey R. Carter
2009-05-26 15:07     ` Tim Rowe
2009-05-26 16:37       ` Georg Bauhaus
2009-05-28  8:37         ` Nicholas Paul Collin Gloucester
2009-06-01 16:22         ` Tim Rowe
2009-06-04  7:35       ` Hibou57 (Yannick Duchêne)
2009-06-04  9:46         ` Martin
2009-06-04 12:16           ` Hibou57 (Yannick Duchêne)
2009-06-04  9:56         ` Jean-Pierre Rosen
2009-06-16  6:58         ` ardjussi
2009-06-16 17:22           ` Jeffrey R. Carter
2009-05-26 18:21     ` Jeffrey R. Carter
2009-05-26 18:35       ` Dmitry A. Kazakov
2009-06-04  7:39       ` Hibou57 (Yannick Duchêne)
2009-06-04  9:02         ` Ludovic Brenta
2009-06-04  9:19           ` Dmitry A. Kazakov
2009-06-04 12:14             ` Hibou57 (Yannick Duchêne)
2009-06-04 14:14               ` Dmitry A. Kazakov
2009-06-04 16:45         ` Jeffrey R. Carter
2009-06-04  7:30     ` Hibou57 (Yannick Duchêne)
2009-06-04  7:55       ` Ludovic Brenta [this message]
2009-06-04  8:45         ` Georg Bauhaus
2009-06-04  9:03           ` Ludovic Brenta
2009-06-04 13:25         ` Robert A Duff
2009-06-04 13:39           ` Martin
2009-06-04 13:08             ` stefan-lucks
2009-06-08 12:41           ` Samuel Tardieu
2009-06-08 19:37             ` Robert A Duff
2009-06-08 22:52               ` Randy Brukardt
2009-06-09  7:39                 ` Dmitry A. Kazakov
2009-06-10  6:55               ` Hibou57 (Yannick Duchêne)
2009-06-10  6:58               ` Hibou57 (Yannick Duchêne)
2009-06-10 11:10                 ` Georg Bauhaus
2009-06-04  7:04   ` Hibou57 (Yannick Duchêne)
2009-06-04  6:04 ` Hibou57 (Yannick Duchêne)
2009-06-06 14:27   ` Marco
2009-06-06 15:37     ` Tomek Wałkuski
replies disabled

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