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.14.53.6 with SMTP id f6mr2746556eec.2.1392951849684; Thu, 20 Feb 2014 19:04:09 -0800 (PST) X-Received: by 10.182.158.196 with SMTP id ww4mr16042obb.5.1392951848700; Thu, 20 Feb 2014 19:04:08 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!goblin1!goblin.stu.neva.ru!w7no10253199lbi.1!news-out.google.com!ow6ni19456lbb.1!nntp.google.com!w7no10253190lbi.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 20 Feb 2014 19:04:08 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=67.231.69.75; posting-account=rdRzuwoAAAAyW3CSBhs_xgfCUJSc1aNt NNTP-Posting-Host: 67.231.69.75 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <90153ba2-ffe8-4696-8459-d81a0f703c9e@googlegroups.com> Subject: Why no abstract non-tagged types? From: Britt Injection-Date: Fri, 21 Feb 2014 03:04:09 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:18719 Date: 2014-02-20T19:04:08-08:00 List-Id: Recently I've been wishing I could declare some otherwise conventional enumeration types as "abstract" so they could only be used as a template for derived types. Such abstract types couldn't be used directly for object declarations. For example: type Valve_State_Base_Type is abstract (Unknown, Open, Closed); -- in Ada 202X Valve_State : Valve_State_Base_Type; -- illegal, type is abstract type Vent_Valve_State_Type is new Valve_State_Base_Type; -- a legal derivation Vent_Valve_State : Vent_Valve_State_Type; -- a legal object declaration I think subtypes of such an abstract type should be implicitly abstract as well: subtype Valve_Cmd_Base_Type is Valve_State_Base_Type range Open .. Closed; Valve_Cmd : Valve_Cmd_Base_Type; -- illegal, base type is abstract subtype Vent_Valve_Cmd_Type is Vent_Valve_State_Type range Open .. Closed; Vent_Valve_Cmd : Vent_Valve_Cmd_Type; -- legal Perhaps this has been asked before but I couldn't find an earlier discussion. Is there any reason why the "abstract" concept couldn't be extended to enumeration and other non-tagged types in Ada 202X? - Britt