C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Issues I have with current Pattern Matching (?????? ????????)
From: Tjernstrom, Staffan (Staffan.Tjernstrom_at_[hidden])
Date: 2020-01-27 08:08:19


>>Arthur:
>> I also strongly object to your proposed core-language syntax. You ask
>> for `||` and `or` to mean subtly different things! Presumably you
>> would also ask for a subtle difference between `&&` and `and`, and
>> between `!` and `not`?
>>

>Mihail:
>Pattern Matching ALWAYS introduce "subtly different" syntax!
>Point{ x, y} (form other langues) is now longer a point declaration it is point matcher. Subtle? Sure it is, but the context is important.
>
>Pattern declaration syntax is* its own language* for better or worse, but it is never confusing because it runs in special scope.>
>
>And it is not subtle because the two actions are radically different, not like with the Concepts at all. We take away one form (as an alternative that does the same thing) and use it to make PM actually useful and
>*compatible* against other languages.
>In practice I suspect we will rarely see mix b/w the two - the pattern version will be predominate.

>From a user viewpoint, there will definitively be a mix. We have a vast, and federally regulated, codebase. I'm not about to go through the paperwork and retesting pain of refactoring our existing code, just to produce the same effect with a new language feature. However, I will most definitively make use of PM once it is available. The mix of idioms is unavoidable, and the foot-gun of subtle syntax differences will be a maintenance nightmare.

________________________________

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


STD-PROPOSALS list run by std-proposals-owner@lists.isocpp.org

Standard Proposals Archives on Google Groups