From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,90108ed846e3f1bf X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 28 Feb 2009 18:19:38 +0100 From: Georg Bauhaus Reply-To: rm.tsoh+bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why constructing functions is a mess [was Language lawyer question: task activation References: <1dusr7frk73m7.nlsagplge0hk.dlg@40tude.net> <09a7aab3-d105-4a40-b25b-e2824cb12f89@j1g2000yqi.googlegroups.com> <24bdd0df-9554-49de-9c5e-99572c9cdf34@g38g2000yqd.googlegroups.com> <1v0f2pkso7p50.vein84avao5t.dlg@40tude.net> <499ede41$0$32665$9b4e6d93@newsspool2.arcor-online.net> <1lhxmo6l2ypux.bei2ffp1m3e$.dlg@40tude.net> <499f2c59$0$31868$9b4e6d93@newsspool3.arcor-online.net> <1vcaimc8kjj30$.kf3rsd670ebp$.dlg@40tude.net> <1gxn72yzshp07$.6ytqydmmz37u.dlg@40tude.net> <49a92c29$0$32670$9b4e6d93@newsspool2.arcor-online.net> <1wzjy9pzbft1m.1lut7nszfkzmp$.dlg@40tude.net> <49a95a12$0$31347$9b4e6d93@newsspool4.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <49a97231$0$30236$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 28 Feb 2009 18:19:45 CET NNTP-Posting-Host: 1b904775.newsspool1.arcor-online.net X-Trace: DXC=eYBm;@?U;YC@Y=h<_c3PkHic==]BZ:afN4Fo<]lROoRA^YC2XCjHcbIhDM9OmT[e>LA:ho7QcPOVCm>CHHjcW02FVBEB`YcCHYE X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4824 Date: 2009-02-28T18:19:45+01:00 List-Id: 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.