C++ Logo

std-proposals

Advanced search

Re: Issues I have with current Pattern Matching (?????? ????????)

From: Tjernstrom, Staffan <Staffan.Tjernstrom_at_[hidden]>
Date: Mon, 27 Jan 2020 14:08:19 +0000
>>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.

Received on 2020-01-27 08:10:55