From: "Ludovic Brenta" <ludovic@ludovic-brenta.org>
Subject: Re: procedural vs object oriented
Date: 27 Apr 2006 06:20:42 -0700
Date: 2006-04-27T06:20:42-07:00 [thread overview]
Message-ID: <1146144042.780839.217550@t31g2000cwb.googlegroups.com> (raw)
In-Reply-To: <16tpmi2zjzfmv.x68lm40hqvl8$.dlg@40tude.net>
Dmitry A. Kazakov wrote:
> On 27 Apr 2006 03:42:10 -0700, Ludovic Brenta wrote:
>> Dynamic dispatching, by definition, means that you don't know which
>> subprogram you call at run-time. The compiler guarantees that the call
>> will succeed (i.e. that there exists a subprogram to dispatch to),
>> but there is uncertainty about which one it is.
>
> (I have an impression that it will not be true in Ada 200Y.)
No, nothing changes in this respect, just synctactic sugar.
> OK, but this is the same uncertainty as in X + 1. You don't know X, so the
> result selected by "+" is uncertain (to you.) Are programs using "+"
> certifiable?
Yes, programs using "+" are certifiable. To obtain the certification,
you prove that X+1 is within range and that the operation does not
raise an exception. Ada's type safety features go a long way to help us
there, so we only have to test for a few boundary cases. SPARK takes
that to its logical conclusion, i.e. static proof.
>> A static procedure call has no uncertainty: when you read the program
>> source, you know exactly which subprogram is called, even in the
>> presence of overloading.
>
> Well, no:
>
> if Read (File) then
> Foo;
> else
> Bar;
> end if;
>
> The uncertainty of a dispatching call is one of the context, exactly as in
> the example above.
Nothing in your example is uncertain. Whatever path execution takes,
you know exactly what's happening.
> Provided, that there is nothing uncertain in how
> dispatching works or what potential targets do.
But with compiler-provided dynamic dispatching, there *is* uncertainty
as to how dispatching works and what the targets are.
--
Ludovic Brenta.
next prev parent reply other threads:[~2006-04-27 13:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-26 8:16 procedural vs object oriented Ananth the Boss
2006-04-26 9:17 ` Jean-Pierre Rosen
2006-04-26 17:44 ` Jeffrey R. Carter
2006-04-26 12:52 ` Dmitry A. Kazakov
2006-04-27 1:33 ` bh
2006-04-27 5:22 ` Ludovic Brenta
2006-04-27 7:36 ` Dmitry A. Kazakov
2006-04-27 10:42 ` Ludovic Brenta
2006-04-27 11:07 ` Maciej Sobczak
2006-04-27 12:03 ` Ludovic Brenta
2006-04-27 17:19 ` Pascal Obry
2006-04-27 15:51 ` Georg Bauhaus
2006-04-27 12:45 ` Dmitry A. Kazakov
2006-04-27 13:20 ` Ludovic Brenta [this message]
2006-04-27 14:24 ` Alex R. Mosteo
2006-04-27 15:17 ` Ludovic Brenta
2006-04-27 16:11 ` Alex R. Mosteo
2006-04-27 20:19 ` Ludovic Brenta
2006-04-27 14:01 ` Jean-Pierre Rosen
2006-04-28 7:46 ` Dmitry A. Kazakov
2006-04-27 15:38 ` Peter Amey
2006-04-27 20:20 ` Ludovic Brenta
2006-04-27 6:55 ` Ananth the Boss
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox