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,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.241.98 with SMTP id wh2mr1088079pbc.7.1337068740645; Tue, 15 May 2012 00:59:00 -0700 (PDT) Path: pr3ni702pbb.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Tue, 15 May 2012 09:58:18 +0200 Organization: cbb software GmbH Message-ID: <4uz9hfn9qr77.1pc1cni103lro.dlg@40tude.net> References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <172r5u18q2247.ze0a856uvhqt.dlg@40tude.net> <1nmd7pjdxlzs1.cwtljox0244r.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-05-15T09:58:18+02:00 List-Id: On Tue, 15 May 2012 01:30:03 -0500, Randy Brukardt wrote: > Specifically, when you "derive" a new type from an existing type, the idea > is that you could give the derived type any declaration and representation > you want (it wouldn't have to be related to the parent, with some limits), > and you could then define conversion functions (always two) similarly to the > way that streaming subprograms are defined. Four conversions. If supertypes supported, i.e. ones exporting their operations to the "parent." This gives you two more conversions. If the new is both sub- and supertype, an "equivalent" type, it would take four conversions to define. (Supertypes are important for bringing existing and originally unrelated types into one class.) > I'm not sure that it is good idea in general, but certainly it makes sense > in limited cases (surely including your enumeration example). 1- all string and character types; 2. all numeric types; 3. managed access types, fat pointers, garbage collection. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de