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

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

Thread Previous | Thread Next
From:
"G.W. Haywood" via perl5-porters
Date:
June 27, 2022 14:43
Subject:
Re: Pre-{Pre-RFC} - match/case syntax
Message ID:
7c82109e-cc3-3d3d-f785-2ab689ceb614@jubileegroup.co.uk
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:
>
>  https://rt.cpan.org/Dist/Display.html?Name=Syntax-Keyword-Match

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.

-- 

73,
Ged.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About