From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Is this an error in compiler Date: Sun, 11 Sep 2022 17:44:13 +0300 Organization: Tidorum Ltd Message-ID: References: <4eecf346-667a-4dee-80b2-c3597b0f6fa7n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net fp8cQnsmNaH51B6F0z/EegHXIP77CvvKqeljrudVJg2Y1ynu37 Cancel-Lock: sha1:HySvKdREZO/y/DL83zg+yuKMfwg= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64319 List-Id: On 2022-09-11 15:30, Jeffrey R.Carter wrote: > On 2022-09-11 10:10, Simon Wright wrote: >> >> I have to say these conditional constructs strike me as regrettable >> Perl-isms, and reduce clarity: >> >>     return foo when blah; >>     raise baz when quux; > > I presume you never use > > exit Name when Condition; > > since it must reduce clarity as well. > > I suggested these constructs for Ada 9X. They were rejected because you > could get the same functionality with an if statement, and the ARG had > more important things to spend their time on. I guess the ARG's workload > must have decreased. I don't find these "raise .. when" or "return .. when" constructs in the Ada 2022 RM draft, so I don't think the ARG has adopted them (yet). I suspect they are GNAT extensions, as is the ability to make a subtype of String with a fixed lower index bound of 1 but an unconstrained upper bound (1 .. <>), as also done in the OP's code. I would not use these non-standard GNAT extensions, as long as GNAT is not the only Ada compiler in the world, which it fortunately isn't.