C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [DRAFT] Another Pattern Matching Proposal

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Tue, 29 Nov 2022 14:02:46 -0500
On Tue, Nov 29, 2022 at 12:12 PM Михаил Найденов via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Hello,
> This is a soft followup of https://lists.isocpp.org/std-proposals/2022/10/4787.php
> which advertised limiting the scope of PM.
>
> In the attached proposal draft a new PM is presented, one with a limited scope and heavy reuse of syntax (no new syntax actually).

Your proposal starts off with this sentence:

> Current proposal aims to be conservative in its goals in order to make it in C++26.

But the importance of that goal presupposes that the current proposals
can't make C++26. I haven't been following anything in the pattern
matching domain much. Is there some reason to believe that syntax is
the primary thing that is holding these proposals back? And I mean
more than just the fact that they introduce new keywords which could
in theory break code. If that's a show-stopping problem, then it will
prevent these proposals from making it into *any* version of C++26.

So what's the evidence that these proposals are stalling out?

Indeed, P2688 seems to be focused on unifying designs, and nothing in
that seems to lend credence to the idea that the fundamental
inhibiting factor in these proposals is syntax.

Basically, I don't think we're at the point where syntax is the
overriding issue slowing down pattern matching proposals. Maybe we are
and I'm not aware of it, but I don't see any evidence that this is the
case.

Personally, the *last* thing I want to see is further canonization of
the idea that lambdas should be more widespread. So piggybacking off
of lambda syntax because it just so happens to have ways to introduce
identifiers feels... unhelpful. Again, if there is some actual problem
with the existing proposals progressing as they are, then this might
be useful as a fallback.

In any case, if you're going to start along what appears to be a
*fourth* path of design for pattern matching, you should at least make
reference to P2688, as it opens up a third path of design intended to
unify aspects of the first two.

Received on 2022-11-29 19:04:47