comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@maps.futureapps.de>
Subject: Re: Why constructing functions is a mess [was Language lawyer question: task activation
Date: Sat, 28 Feb 2009 18:19:38 +0100
Date: 2009-02-28T18:19:45+01:00	[thread overview]
Message-ID: <49a97231$0$30236$9b4e6d93@newsspool1.arcor-online.net> (raw)
In-Reply-To: <p2ugsc0q86gs.1wau2yijrzj7t.dlg@40tude.net>

Dmitry A. Kazakov wrote:

> This only shows that you provided a wrong C++ example. The right one, i.e.
> corresponding to the case I presented is
> 
> class T
> {
> public:
>    virtual void op() = 0;
>    T (char constraint);
> private:
>    char c;
> };

I don't understand. Your example read

   type T (<>) is abstract tagged limited private;
 private
   type T ( ... constraints ...) is ...

So there is no way for a client to declare an object of type T,
for one thing because there is no way to provide constraints.
Consequenty, a corresponding C++ class T cannot have a public
constructor (I thought).

>>> Probably you refer to
>>> the trick when <> is used to prevent uninitialized objects. But T is
>>> already abstract. You cannot create it in any way.

Yes, from some viewpoint there is overlap in measures
that prevent clients from creating objects of type T.

>> When S is derived from some public T without a (<>),
>> I can name T in S'(T with ...) when T is just abstract.
>> This illustrates that (<>) prevents (meaningful) public derivation.
> 
> No. A meaningful derivation is prevented by the language bug that confuses
> constructors with functions. These two different concepts evidently collide
> when types are abstract.
> 
> You misinterpret the purpose of <>.

How so?  A T(<>) implies that clients cannot explicitly
constrain the set of values in T from (public) outside
when nothing public yields a constrained object.
A declaration, subtypes, derived types or anything
that is not provided by type T(<>) alone is insufficient.
If T is abstract, this is an even bigger sign post.

Why would one want to derive from such a type?

The next thing I will do when seeing such a "restrictive" type
is to look for some factory, or some children.
These may provide constraints and remove restrictions.

> If they did, they would
> also prohibit such *final* types from being abstract. Obviously.

T is not final in T's package hierarchy, is it?
Yes, Ada's O-O type system permits many multiply interwoven effects.
It doesn't look neat, and I guess it is not alway consistent with
definitions external to Ada.




  reply	other threads:[~2009-02-28 17:19 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-19 17:37 Language lawyer question: task activation Adam Beneschan
2009-02-19 17:57 ` Dmitry A. Kazakov
2009-02-19 23:57   ` Robert A Duff
2009-02-20 13:22     ` Dmitry A. Kazakov
2009-02-23  7:36       ` Jean-Pierre Rosen
2009-02-20  5:43   ` christoph.grein
2009-02-20 10:44     ` Dmitry A. Kazakov
2009-02-20 11:14       ` christoph.grein
2009-02-20 12:07         ` mockturtle
2009-02-20 13:22           ` Dmitry A. Kazakov
2009-02-20 16:45             ` Georg Bauhaus
2009-02-20 18:41               ` Dmitry A. Kazakov
2009-02-20 22:19                 ` Georg Bauhaus
2009-02-21  8:31                   ` Dmitry A. Kazakov
2009-02-27 23:29                     ` Randy Brukardt
2009-02-28  8:13                       ` Why constructing functions is a mess [was Language lawyer question: task activation (was: Language lawyer question: task activation)) Dmitry A. Kazakov
2009-02-28 12:20                         ` Why constructing functions is a mess [was Language lawyer question: task activation Georg Bauhaus
2009-02-28 13:45                           ` Dmitry A. Kazakov
2009-02-28 15:36                             ` Georg Bauhaus
2009-02-28 16:22                               ` Dmitry A. Kazakov
2009-02-28 17:19                                 ` Georg Bauhaus [this message]
2009-02-28 17:48                                   ` Dmitry A. Kazakov
2009-02-28 18:39                                     ` Georg Bauhaus
2009-02-28 20:17                                       ` Dmitry A. Kazakov
2009-03-02 16:13                                         ` Georg Bauhaus
2009-03-02 17:46                                           ` Dmitry A. Kazakov
2009-03-02 18:50                                             ` Georg Bauhaus
2009-03-02 21:02                                               ` Dmitry A. Kazakov
2009-03-03  7:04                                                 ` christoph.grein
2009-03-03  8:45                                                   ` Dmitry A. Kazakov
2009-03-03  9:27                                                     ` christoph.grein
2009-03-03  9:34                                                       ` Dmitry A. Kazakov
2009-03-03 19:13                                                       ` Pascal Obry
2009-03-04  5:29                                                         ` christoph.grein
2009-03-04  8:32                                                           ` Dmitry A. Kazakov
2009-03-04  9:05                                                             ` christoph.grein
2009-03-04  9:47                                                               ` Dmitry A. Kazakov
2009-02-28 23:12                             ` Maciej Sobczak
2009-03-01  8:23                               ` Dmitry A. Kazakov
2009-02-19 23:54 ` Robert A Duff
2009-02-20 10:18 ` Robert_Matthews
2009-02-20 10:34   ` christoph.grein
2009-02-20 14:16   ` Robert A Duff
2009-02-20 16:57     ` Robert_Matthews
replies disabled

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