comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Q: Endless loop by dispatching
Date: Sat, 19 Jul 2003 05:48:23 GMT
Date: 2003-07-19T05:48:23+00:00	[thread overview]
Message-ID: <3F18DB9D.5020205@attbi.com> (raw)
In-Reply-To: Z22Sa.82038$sY2.36618@rwcrnsc51.ops.asp.att.net

tmoran@acm.org wrote:

>   type Root_Type is tagged private;
>   type Root_Type is new Ada.Finalization.Controlled with private;
> should be equivalent, right?  It seems to me that additional ways to
> say the same thing are of modest value, while ways to say something
> different are of greater value, so I would want those two declarations
> to accomplish different, not the same, things.

No I believe that having TWO dispatching operations named Initialize, 
and which one is called depends on whether the call is implicit or 
explicit is potentially confusing to users.  The same effect occurs if 
you have two objects with default initializations, and the one in the 
package spec calls one version of Initialize, and the one in the package 
calls a different Initialize.

This as I said was a small program to demonstrate where the people on 
both sides of the discussion weren't "getting it."  I wanted to 
demonstrate that even if everyone did have the identical understanding 
of the overridding rules, these funny cases do exist.  (Remember the 
part about users shooting themselves in the foot.)  And in the worst 
cases, the point at which the overriding occurs does affect run-time 
behavior.

The fact that I tripped over a case where compilers disagree tells us 
(the ARG) two things:

1) There is definitely a problem.
2) If it was a serious problem, users would have already run into it.

I can't testify that users hadn't tripped over it before, but now it is 
definitely out in the open.

Which rule do you prefer:

1) All objects of a type derived from Ada.Finalization.Controlled by 
default call the same version of Initialize?

or

2) Information hiding in effect AT THE PLACE OF THE CALL can determine 
which version of a subprogram is called?

If you vote for 2), I won't argue, I'll take it as data.  The important 
part for the ARG is that in this (foot shooting) case we have to choose. 
  The two alternatives are clearly incompatible, and that is what the 
program was written to demostrate.

-- 

                                                        Robert I. Eachus

�In an ally, considerations of house, clan, planet, race are 
insignificant beside two prime questions, which are: 1. Can he shoot? 2. 
Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and 
Steve Miller.




  reply	other threads:[~2003-07-19  5:48 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11  8:22 Q: Endless loop by dispatching Michael Erdmann
2003-07-11  9:46 ` Jean-Pierre Rosen
2003-07-11 15:19   ` Michael Erdmann
2003-07-11 10:01 ` Q: " Dmitry A. Kazakov
2003-07-11 15:07   ` Michael Erdmann
2003-07-12  1:41     ` Jeffrey Carter
2003-07-14  8:48     ` Dmitry A. Kazakov
2003-07-14 18:38       ` Randy Brukardt
2003-07-15  8:47         ` Dmitry A. Kazakov
2003-07-15 17:23           ` Randy Brukardt
2003-07-16  8:08             ` Dmitry A. Kazakov
2003-07-16 17:44               ` Robert I. Eachus
2003-07-17  1:57               ` Robert A Duff
2003-07-18  9:10                 ` Dale Stanbrough
2003-07-18 20:26                   ` Robert I. Eachus
2003-07-18 21:35                     ` tmoran
2003-07-19  0:25                       ` Robert I. Eachus
2003-07-19  2:30                         ` tmoran
2003-07-19  5:48                           ` Robert I. Eachus [this message]
2003-07-21  8:38                             ` Dmitry A. Kazakov
2003-07-21 10:08                               ` Robert I. Eachus
2003-07-21 13:21                                 ` Dmitry A. Kazakov
2003-07-21 18:51                                   ` Robert I. Eachus
2003-07-22  7:41                                     ` Dmitry A. Kazakov
2003-07-22 10:36                                       ` Lutz Donnerhacke
2003-07-22 12:11                                         ` Dmitry A. Kazakov
2003-07-22 12:18                                           ` Lutz Donnerhacke
2003-07-22 14:46                                             ` Dmitry A. Kazakov
2003-07-22 15:11                                               ` Lutz Donnerhacke
2003-07-23  8:12                                                 ` Dmitry A. Kazakov
2003-07-19 14:44                     ` Chad R. Meiners
2003-07-20 12:36                       ` Robert I. Eachus
2003-07-11 16:27 ` T. Kurt Bond
2003-07-12  8:37   ` Michael Erdmann
2003-07-15  7:11     ` Kenneth Almquist
replies disabled

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