dotnet / dotnet/csharpstandard

Revisiting the name of the term "pattern input value”

Open
#1,424 0 comments 0 reactions 1 assignee Claimed by @jskeet View on GitHub
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

In Comment https://github.com/dotnet/csharpstandard/pull/873#discussion_r2364479857, Nigel mentioned this term and the possible need to change its name. We decided that while it was worth addressing, we'd not have it hold up the adoption of the patterns feature in V8.

> Is a value matched/tested against a pattern, or is a pattern matched/tested against a value?
>
> My unscientific guess is value against pattern is the more common usage (including dare I mention in MS web pages), the Standard often goes with pattern against value – though not consistently, the edit below to line 5 changes from “pattern is tested against” to “data … matched against [patterns]”, while line 7 goes with “pattern is tested against”.
>
> Which should the Standard use, or can it be happily inconsistent (variety is after all the spice of life :-))
>
> I will leave you to muse, during review I have so far intentionally not suggested any changes from one to the other, or for consistency – but apologies if my resolve fails! ;-)
>
> Addendum: The term “pattern input value” (emphasis added) is related to this – it is currently defined and used 12 times after in the Standard. Other languages tend to use terms which don’t imply that the value is going “into” the pattern (in the sense an argument value goes into a method). For example F#, a sibling language to C#, has a match expression, similar to C#’s switch expression, and talks about the input to the match, not the input to the pattern.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.