Replies: 3 comments 15 replies
-
My suggestion for list patterns is to always have both brackets and curly braces, even if they are empty. So the empty list would be |
Beta Was this translation helpful? Give feedback.
-
I've read the list pattern proposal more than once and the design notes and I still have absolutely no idea what _ = list switch
{
{ .., >= 0 } => 1,
{ < 0 } => 2,
{ Count: <= 0 or > 1 } => 3,
}; or _ = list switch
{
{ .., >= 0 } => 1,
{ ..{ .., < 0 } } => 3,
}; are supposed to do. I'm really am not a fan of features that ditch clarity in favor of brevity. |
Beta Was this translation helpful? Give feedback.
-
What if list patterns, list deconstructors, and a new list initialization pattern is added as well for symmetry - this time maybe taking immutable/init-only lists as well? It'd require a new list syntax overall. Maybe |
Beta Was this translation helpful? Give feedback.
-
https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-06-07.md
Agenda
a. Exhaustiveness
b. Length pattern feedback
Beta Was this translation helpful? Give feedback.
All reactions