Closed
Conversation
Crell
reviewed
Nov 20, 2020
Crell
reviewed
Nov 20, 2020
Crell
reviewed
Nov 20, 2020
Crell
reviewed
Nov 20, 2020
Crell
reviewed
Nov 20, 2020
Crell
reviewed
Nov 20, 2020
Contributor
|
Still missing, IMO:
Recommended: A comparison with ternaries, not just switch. I've been saying since day 1 that match is more akin to a multi-armed ternary than it is to a switch statement. 😄 Optional: Note that if more complex checks than === are needed, |
Member
Author
Don't really know how to write this up in all honesty.
I made a mention about it but I don't imagine that's what you want. |
Crell
reviewed
Nov 20, 2020
This includes: - match expression page - UnhandledMatchError page Co-authored-by: Larry Garfield <larry@garfieldtech.com>
Crell
reviewed
Nov 22, 2020
| Similarly to a <literal>switch</literal> statement, a | ||
| <literal>match</literal> expression has a subject expression that is | ||
| compared against multiple alternatives. Unlike <literal>switch</literal>, | ||
| it will evaluate to a value much like ternary expressions |
Contributor
There was a problem hiding this comment.
Suggested change
| it will evaluate to a value much like ternary expressions | |
| it will evaluate to a value much like ternary expressions. |
Crell
reviewed
Nov 22, 2020
| </listitem> | ||
| <listitem> | ||
| <simpara> | ||
| <literal>Match</literal> arms do not fallthrough compared to switch cases. |
Contributor
There was a problem hiding this comment.
Suggested change
| <literal>Match</literal> arms do not fallthrough compared to switch cases. | |
| <literal>Match</literal> arms do not fall-through to later cases the way <literal>switch</literal> statements do. |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a W.I.P. any helped appreciated, especially @iluuu1994 for reviewing.
I'm struggling to describe some of the features and how to go about it, some of the terminology is copied from the Rust documentation: https://doc.rust-lang.org/reference/expressions/match-expr.html