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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.58.213.132 with SMTP id ns4mr3976680vec.27.1393450819215; Wed, 26 Feb 2014 13:40:19 -0800 (PST) X-Received: by 10.140.97.101 with SMTP id l92mr41571qge.28.1393450819194; Wed, 26 Feb 2014 13:40:19 -0800 (PST) Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!m5no2467851qaj.1!news-out.google.com!dr7ni7699qab.1!nntp.google.com!w5no539006qac.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 26 Feb 2014 13:40:17 -0800 (PST) In-Reply-To: <2e5f406d-3fd1-4f8b-a1dd-c0c2a196cc94@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=129.59.203.137; posting-account=7Oy7OQoAAABhVYFOo553Cn1-AaU-bSfl NNTP-Posting-Host: 129.59.203.137 References: <90153ba2-ffe8-4696-8459-d81a0f703c9e@googlegroups.com> <2e5f406d-3fd1-4f8b-a1dd-c0c2a196cc94@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Why no abstract non-tagged types? From: Eryndlia Mavourneen Injection-Date: Wed, 26 Feb 2014 21:40:19 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 1959 Xref: number.nntp.dca.giganews.com comp.lang.ada:185080 Date: 2014-02-26T13:40:17-08:00 List-Id: On Wednesday, February 26, 2014 12:52:31 PM UTC-6, Dan'l Miller wrote: > Please give some Ada202X mock-up of precisely what by-value types and scalar classes would wisely enable that are inexpressible throughout Ada2012. Would something like the following work for you? package Abstract_Color is type Color is (Red, Green, Blue); package Literal is function Red return Color is abstract; function Green return Color is abstract; function Blue return Color is abstract; end Literal; end Abstract_Color; Then, you can reference Abstract_Color.Literal.Red, etc. You also can make it generic, as Shark suggested.