comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Is this an error in compiler
Date: Sun, 11 Sep 2022 14:59:25 +0200	[thread overview]
Message-ID: <tfkm3d$cj4$1@gioia.aioe.org> (raw)
In-Reply-To: tfkkcj$1talo$1@dont-email.me

On 2022-09-11 14: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.

And the evaluation order of the return value vs the condition? E.g. in

    return Boolean'Input (Stream) when Boolean'Input (Stream);

There is no issue with exit-when of course. Return and, even, raise (as 
you can have an expressions there with Exception_Occurrence type) look 
problematic.

I would expect the condition evaluated first, but that is kind of 
"German" way of reading texts... 😂

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2022-09-11 12:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-11  7:19 Is this an error in compiler reinert
2022-09-11  8:10 ` Simon Wright
2022-09-11 10:52   ` reinert
2022-09-11 12:30   ` Jeffrey R.Carter
2022-09-11 12:59     ` Dmitry A. Kazakov [this message]
2022-09-11 14:44     ` Niklas Holsti
2022-09-11 15:47       ` Jeffrey R.Carter
2022-09-11 16:47         ` reinert
2022-09-11 17:18           ` Dmitry A. Kazakov
2022-09-12  7:05       ` Simon Wright
2022-09-11 15:14   ` Oliver Kellogg
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox