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: border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: J Kimball Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Tue, 15 Apr 2014 00:28:44 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> NNTP-Posting-Host: 50.7.1.98 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: loke.gir.dk 1397539724 21671 50.7.1.98 (15 Apr 2014 05:28:44 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 15 Apr 2014 05:28:44 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Thunderbird/28.0 In-Reply-To: Xref: number.nntp.dca.giganews.com comp.lang.ada:185740 Date: 2014-04-15T00:28:44-05:00 List-Id: More than you'd think I guess. Maybe I overuse them. I try as hard as I can to get anything with discrete values into a matching type. It'd be a lot more painful in a language with switch statements that use breaks. The coverage rules make me feel safer. On 04/14/2014 07:18 PM, Randy Brukardt wrote: > We've (the ARG) already discussed this issue - see the e-mail of > AI12-0086-1. Proper solutions are way too incompatible with existing code, > and solutions that aren't incompatible are way too complex (involving > allowing several possible ways to write the same thing, but still > disallowing other cases so that we are still getting completeness checking). > So this is only fixable with added syntax, but this problem is nowhere near > important enough to add syntax (how common are nested variants?). > > Randy. > > "J Kimball" wrote in message > news:lifq02$dap$1@loke.gir.dk... >> On 03/25/2014 04:41 PM, Stoik wrote: >>> I think that even a casual user of Ada should be able to influence >>> somehow the new version of Ada. I wonder what is high on your list of >>> wishes for Ada 202X? >>> I suspect many of the proposals could be tested in GNAT before being >>> introduced (or rejected) in the new version. One could add a switch to >>> GNAT indicating that we want to use some of the experimental features. >>> >> >> I found myself in a situation in which some syntactic sugar on Ada 2012 >> might be able to help with. >> >> type T is ...; >> >> A : T; >> >> case A is >> when X => null; >> when Y | Z => >> case A is >> when Y => null; >> when Z => null; >> when X => null; -- Bleh >> end case; >> end case; >> >> I wish there was someway I wouldn't have to cover X for the inner case >> like maybe the branches could be have variables with implicitly defined >> subtypes. >> >> case A is >> when X => null; >> when B : Y | Z => >> case B is >> when Y => null; >> when Z => null; >> end case; >> end case; >> >> A bit of exception choice syntax and an implicit subtype a la Ada 2012. >> >> B : Y | Z might translate to: subtype /anonymous/ is T with >> Static_Predicate => T in Y | Z; B : /anonymous/; -- Predicate syntax might >> be wrong. >> >> Is a minor thing, but would save me grumbling each time I do this. > >