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,fad7742cc8dcbb84 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: type and subtype Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.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: <1122215078.559279.16980@f14g2000cwb.googlegroups.com> <87mzocrx9d.fsf@insalien.org> <_vPEe.3516$Uk3.77@newsread1.news.pas.earthlink.net> Date: Mon, 25 Jul 2005 10:23:34 +0200 Message-ID: NNTP-Posting-Date: 25 Jul 2005 10:23:32 MEST NNTP-Posting-Host: 5096b81f.newsread4.arcor-online.net X-Trace: DXC=e9P\0K^cBi>OjE[7VlJ2<0:ejgIfPPld4jW\KbG]kaM8XY;eg@jLYeI^><>f3dFY:]Em?:0MgaD3 X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3748 Date: 2005-07-25T10:23:32+02:00 List-Id: On Sun, 24 Jul 2005 16:40:26 GMT, Jeffrey Carter wrote: > Ludovic Brenta wrote: >> >> Two subtypes of the same type are compatible with one another. One >> can convert between them using an implicit type conversion (i.e. no >> special syntax required). > > There is no type conversion between subtypes of the same type, since > they are the same type. There are checks that the value of the source > matches the constraints of the destination. This sounds much like hairsplitting. However it is an important issue for the future. I think that Ludovic's view is more consistent: checks are just a part of the conversion which otherwise is an identity function, because *presently* the representation is required to be same. But representation is an implementation detail and thus cannot count. Moreover it is very desirable to allow subtypes having different representations. For example: statically constrained subtypes with removed constant discriminants from their values; T'Class constrained to some specific type S could remove the type tag from its objects, etc. Such subtypes would require more-than-checks conversions. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de