comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Rational for not making cursor tagged in Containers
Date: Thu, 19 Apr 2007 16:45:36 -0400
Date: 2007-04-19T16:45:36-04:00	[thread overview]
Message-ID: <wccodlkdrf3.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1177010938.200523.325290@p77g2000hsh.googlegroups.com

Anh Vo <anhvofrcaus@gmail.com> writes:

> On Apr 19, 11:25 am, Robert A Duff <bobd...@shell01.TheWorld.com>
> wrote:
>>
>> I suppose it's because there's no need for type extension or dispatching
>> calls.  So why pay the overhead?
>
> Well, I have not yet come across the situation where a Container type
> needs to be extended. And yet, overhead was already paid.

True.

I think the rationale is that container types typically need
finalization, so they need to be derived from Controlled, so they are
tagged.  It was not necessary to make them VISIBLY tagged, but
I think the idea was "why not?".  You're paying for the tag
anyway, whether or not it's in the visible part.

That leads to the question, why can't we have untagged types with
finalization?  The answer is that during Ada 9X, the
derive-from-controlled idea was thought to be the simplest.
And finalization almost didn't make it into Ada 95.

>> A different question might be: Why is the prefix notation not allowed
>> for untagged types?  I don't know the answer to that, but it's probably
>> documented in the relevant AI.
>
> Then, it is not an extended (objectable) type. I will look for it.

And another question: why can't untagged types be extended?
That was allowed in the original design for Ada 9X.
Tags are needed for dispatching, but they are not needed
for extension.

>> I'm not a big fan of prefix notation, by the way.
>
> It is not uncommon that different people have different thinking. For
> me prefixed notation clearly has advantages. Of course, I like to use
> them to the fullest :-)

There is an advantage: If you have type P1.T1, with operation Mumble,
and P2.T2 extends P1.T1, and X is of type T2, do I say "P1.Mumble(X, ...)",
or "P2.Mumble(X, ...)"?  It's confusing, because it depends whether Mumble
is class-wide or dispatching, which is a conceptually minor
distinction.  And it's not unusual to change from dispatching
to class-wide.  The notation "X.Mumble(...)" avoids that confusion.

Nonetheless, it just seems weird to me to pretend that Mumble
is inside X, like a component.  There must be a better way.

- Bob



  reply	other threads:[~2007-04-19 20:45 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-19 16:05 Rational for not making cursor tagged in Containers Anh Vo
2007-04-19 18:25 ` Robert A Duff
2007-04-19 19:28   ` Anh Vo
2007-04-19 20:45     ` Robert A Duff [this message]
2007-04-19 21:43       ` Dmitry A. Kazakov
2007-04-19 23:59         ` Ray Blaak
2007-04-20  7:54           ` Dmitry A. Kazakov
2007-04-20 10:56             ` Georg Bauhaus
2007-04-20 10:39               ` Dmitry A. Kazakov
2007-04-20 14:42                 ` Georg Bauhaus
2007-04-20 14:45                   ` Georg Bauhaus
2007-04-20 15:13                   ` Dmitry A. Kazakov
2007-04-20 19:37                     ` Georg Bauhaus
2007-04-20 19:32                       ` Dmitry A. Kazakov
2007-04-20 20:59                         ` Robert A Duff
2007-04-20 22:14                           ` Dmitry A. Kazakov
2007-04-23 17:38                             ` Adam Beneschan
2007-04-23 19:18                               ` Dmitry A. Kazakov
2007-04-24  0:15                                 ` Adam Beneschan
2007-04-24 10:43                                   ` Dmitry A. Kazakov
2007-04-24 16:27                                     ` Adam Beneschan
2007-04-24 20:19                                       ` Dmitry A. Kazakov
2007-04-26  0:58                                         ` Adam Beneschan
2007-04-26  7:50                                           ` Dmitry A. Kazakov
2007-04-26  8:09                                             ` Markus E Leypold
2007-04-27  8:46                                               ` Dmitry A. Kazakov
2007-04-27 11:37                                                 ` Markus E Leypold
2007-04-28 17:35                                                   ` Dmitry A. Kazakov
2007-04-29  2:31                                                     ` Randy Brukardt
2007-04-29  8:45                                                       ` Dmitry A. Kazakov
2007-04-27 20:44                                               ` Robert A Duff
2007-04-26  8:33                                             ` Markus E Leypold
2007-04-26 11:09                                               ` Markus E Leypold
2007-04-20 19:55                       ` Randy Brukardt
2007-04-22  9:54                         ` Georg Bauhaus
2007-04-22 11:19                           ` Dmitry A. Kazakov
2007-04-20 20:44                       ` Robert A Duff
2007-04-21  5:38                         ` Randy Brukardt
2007-04-22  1:14                           ` Robert A Duff
2007-04-22  4:08                             ` Randy Brukardt
2007-04-20 20:11                     ` Randy Brukardt
2007-04-20 21:28                       ` Dmitry A. Kazakov
2007-04-21  5:33                         ` Randy Brukardt
2007-04-21  9:39                           ` Dmitry A. Kazakov
2007-04-22  4:28                             ` Randy Brukardt
2007-04-22  8:38                               ` Dmitry A. Kazakov
2007-04-23 23:26                                 ` Randy Brukardt
2007-04-24 10:43                                   ` Dmitry A. Kazakov
2007-04-24  8:58                                 ` Georg Bauhaus
2007-04-24 12:21                                   ` Dmitry A. Kazakov
2007-04-21  4:48                       ` unifying arrays and records (was Re: Rational for not making cursor tagged in Containers) Ray Blaak
2007-04-20 17:05             ` Rational for not making cursor tagged in Containers Ray Blaak
2007-04-20 18:46               ` Dmitry A. Kazakov
2007-04-20 18:52                 ` Ray Blaak
2007-04-20 19:54                   ` Robert A Duff
2007-04-20  1:18         ` Anh Vo
2007-04-20  7:53           ` Dmitry A. Kazakov
2007-04-20  9:26             ` Maciej Sobczak
2007-04-20 10:15               ` Dmitry A. Kazakov
2007-04-20 11:59           ` Jean-Pierre Rosen
2007-04-20 13:23             ` Anh Vo
2007-04-20 16:02               ` Jean-Pierre Rosen
2007-04-21  2:53                 ` Anh Vo
2007-04-20  3:03   ` Randy Brukardt
2007-04-20  2:53 ` Randy Brukardt
2007-04-20 16:08   ` Anh Vo
replies disabled

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