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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada case-statement Date: Wed, 14 Mar 2018 18:16:27 -0500 Organization: JSA Research & Innovation Message-ID: References: <365d65ea-5f4b-4b6a-be9b-1bba146394ab@googlegroups.com> Injection-Date: Wed, 14 Mar 2018 23:16:28 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="7659"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:50980 Date: 2018-03-14T18:16:27-05:00 List-Id: "Stephen Davies" wrote in message news:365d65ea-5f4b-4b6a-be9b-1bba146394ab@googlegroups.com... ... > Ok, I know this isn't going to happen, I just wanted to > put it out there anyway. Since the deadline for suggestions for Ada 2020 was January 15th, you are right. ;-) OTOH, someone made a fairly similar suggestion before the deadline; it was folded into existing AI12-0214-1. (As usual, no one is really doing a good job of explaining the "problem" rather than proposing a cool "solution". The ARG is perfectly capable of inventing a half-dozen solutions to any problem. :-) This matters mainly because we want to minimize the number of "solutions" in a language update.) The problem is that we have far more "problems" and suggestions than we have time to implement in the Standard. We are trying to figure out right now how to prioritize the 60+ problems/solutions on our plate. Some worthy ideas are certainly going to go nowhere, even though they might be fine. In any case, you can get what you want with some additional text, so I would guess that the priority of such a change would be relatively low: declare Selector : Day_Type renames Calculate_Day; subtype Weekend_Subtype is Day_Type range Sat .. Sun; -- Or use a static predicate if the range is discontiguous. begin case Selector is when Mon .. Fri => ... when Sat | Sun => ... case Weekend_Subtype'(Selector) is -- A type conversion works, too. when Sat => ... when Sun => ... end case; end case; end; Personally, I don't like declarations without explicit subtypes, as the subtype of an object is critical for understanding the semantics. Not having the subtype in the source makes it much harder to understand the semantics. Currently, the "id :" notation occurs in three places without an explicit subtype (block ids, loop ids, exception occurrences). The first two have types that don't even have names (and id can only be used in a handful of circumstances). The third has a well-defined composite type that has no subtypes (so there is no semantic information to be gained by writing it out). Expanding the "id :" notation would definitely harm understandability of Ada code, and with readability being pretty much the first priority for Ada syntax, that's a bad thing. We have been considering making the subtype name in an object renames optional -- the subtype is a lie anyway (since it is ignored semantically), and other important properties of the renamed object like "constant" are omitted. That's about as far as I will go for typeless declarations (and perhaps even that is too far). But - I am not the ARG, I'm just one member. The actual language agreed on may differ. :-) Randy.