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,782af4edeb84c4b7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: basic basic ada question Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1161268231.345231.242170@m73g2000cwd.googlegroups.com> <4537bc65_1@newsfeed.slurp.net> <5567b72ia0c9$.1b6yl0tpfscj5$.dlg@40tude.net> <13bxqw4vydm93$.vlnod0hnsogo.dlg@40tude.net> <2lh16y6eetpr.174c6t4885tws$.dlg@40tude.net> <1003e77ytohm0$.1kiriiggzo76m.dlg@40tude.net> <1anu82k75pz5r.1ca9f66hmzfqg$.dlg@40tude.net> Date: Tue, 24 Oct 2006 09:34:59 +0200 Message-ID: <36nbld7s8m8m$.15t5eyu0hl1am.dlg@40tude.net> NNTP-Posting-Date: 24 Oct 2006 09:34:59 CEST NNTP-Posting-Host: 693ca52b.newsspool4.arcor-online.net X-Trace: DXC=_Tbd8LfYRYk:i=48;n?Z:`4IUK On Mon, 23 Oct 2006 11:49:17 -0400, Robert A Duff wrote: > "Dmitry A. Kazakov" writes: > >> type T is abstract ...; >> function Greeting_Message return String is abstract; > > I presume the above is supposed to say (X : T), right? Yes, my fault. > If so, I don't see anything illegal here. OK, I didn't specifically mean Ada. As for Ada if Initialize were a declared part of the default constructor, then view conversions to the class could be statically detected and made illegal. Though, I would consider to disallow them for the types to replace present tagged types. I mean the types with the type tag stored in the objects. For the tag-less types it not a problem, because T'Class would create a new object constructed through a copy constructor. >> procedure Initialize (X : in out T) is >> begin >> Put_Line ("Hi," & Greeting_Message (T'Class (X))); -- Illegal! >> end Initialize; >> >> type S is new T with ...; >> function Greeting_Message return String is >> begin >> return "I am T!"; >> end Greeting_Message; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de