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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 02 Mar 2009 19:50:53 +0100 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.19 (Macintosh/20081209) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why constructing functions is a mess [was Language lawyer question: task activation References: <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> <49a97231$0$30236$9b4e6d93@newsspool1.arcor-online.net> <1mjbcbequf1wz.1o3nwuz7oqteo.dlg@40tude.net> <49a984f6$0$30226$9b4e6d93@newsspool1.arcor-online.net> <49ac0595$0$31344$9b4e6d93@newsspool4.arcor-online.net> <1p6sf3ykej2ls.10jmdonrmif5h.dlg@40tude.net> In-Reply-To: <1p6sf3ykej2ls.10jmdonrmif5h.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <49ac2a8e$0$30232$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 02 Mar 2009 19:50:54 CET NNTP-Posting-Host: bb2c4cb3.newsspool1.arcor-online.net X-Trace: DXC=UdCOH`Oo`DQcHPTNZh_e7Qic==]BZ:af^4Fo<]lROoRQ^YC2XCjHcbY[b9FcOG[i2\;9OJDO8_SKVNSZ1n^B98iZ]?I=E;lZ]VS X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4844 Date: 2009-03-02T19:50:54+01:00 List-Id: Dmitry A. Kazakov schrieb: > On Mon, 02 Mar 2009 17:13:09 +0100, Georg Bauhaus wrote: > >> Dmitry A. Kazakov schrieb: >> >>> A derived type works fine: >>> >>> type My_Plant is new Power_Plant with null record; >>> function Create return My_Plant is >>> begin >>> return (Power_Plant'(Create ("my plant")) with null record); >>> end Create; >>> Now, the point is that this model of construction does not work with >>> abstract types because of fundamental reasons. It is not (<>) which is >>> broken, but the construction model. >> OK, got your point, sorry for being so dense. > > No, you still have not. Yes, (Abstract_Function_Call with ...) doesn't hold water, I think I got it. Constructor functions are not constructors for "abstract subobjects", they are primitive which is doubtful (as is explained in a 1994 thread Constructor in ADA9X) and so on... Please let the ARG know, in case this has been overlooked. (The compiler bug is still a bug insofar as no constructor function is needed to crash it. This dreadful line in einfo.adb seems to apply in the case of Ada 95 only.) Should the following work for all suitable type names T at least, no function anywhere? I just don't know, I haven't found anything to the contrary, but all compilers available crash. T(<>) ... :> S, X: S := (T with ...); >> Should the following work for unconstrained abstract Power_Plant? >> (some day, e.g. >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34507 ) > > It is not a compiler bug. It is a language bug. Besides, I have GNAT Pro. Does GNAT Pro not crash on this, which does not have a constructor function? ... package P1 is type T1(<>) is abstract tagged limited private; private type T1(X: Character) is tagged limited null record; end P1; package P2 is type T2 is new P1.T1 with private; private type T2 is new P1.T1 with null record; X: T2 := (P1.T1 with null record); -- Bang! end P2; ...