develooper Front page | perl.perl5.porters | Postings from June 2022

Re: Pre-{Pre-RFC} - match/case syntax

Thread Previous | Thread Next
"G.W. Haywood" via perl5-porters
June 27, 2022 14:43
Re: Pre-{Pre-RFC} - match/case syntax
Message ID:
Hi there,

On Fri, 24 Jun 2022, Paul "LeoNerd" Evans wrote:

> ... a lot of design work still to be done on this; several of the
> big questions are sat as "Wishlist" RT tickets on the queue:

Amongst other things

> 135129: I rather dislike option 1

Agreed.  It would violate the Principle Of Least Surprise if the
compilation could result in an execution order which was in any way
different from the order in which it's written in the source.  Were
that possible, I should never use it.

> 135128: We can clearly do much better here.

Maybe, but I'm not convinced that it's necessary.

My feeling is all that's needed is something which behaves as nearly
as possible to the way that, in C, the 'switch' statement behaves.
The casual coder should be able to, er, use it without pain.  If it
got any more fraught than that I'd probably stick to if/elsif/else
which, although ugly, has after all managed well enough for decades.

Whatever it turns out to be, Heaven forbid that it's 'smart'.

Please try to keep separate the concepts of looping and branching.



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About