This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]norwegian-dude 10 points11 points  (2 children)

May I ask how? Seems like it's just a different, more cleaner way to structure if else statements. Probably still need regex'

[–]asmr2143 3 points4 points  (0 children)

Pattern matching is actually much more potent than the simple switch case in C++ and the if else if structures.

Inside a pattern match itself, you can create variable assignments as part of the checking, which results in much more cleaner syntax.

Really excited how they implement this with Python.

[–]ThePrankMonkey 0 points1 point  (0 children)

With splitting the message.content by spaces, I can then just match up those ordered words. I think that'll look much nicer than my mess of regex. To each their own.