-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Labels
dotnet-fsharp/svchelp wantedGood for community contributors to help [up-for-grabs]Good for community contributors to help [up-for-grabs]
Description
A compelling use for the nameof
pattern is not presented. I can’t see the usefulness from the example given.
let f (str: string) =
match str with
| nameof str -> "It's 'str'!"
| _ -> "It is not 'str'!"
seems to work identically to this:
let f2 (s: string) =
match s with
| "str" -> "It's 'str'!"
| _ -> "It is not 'str'!"
The page linked does not help to clarify.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 8a3ed054-03c9-375f-403b-68f0356d5870
- Version Independent ID: 3c167003-13e8-359b-e919-693258e7f48b
- Content: Pattern Matching - F#
- Content Source: docs/fsharp/language-reference/pattern-matching.md
- Product: dotnet-fsharp
- GitHub Login: @cartermp
- Microsoft Alias: dotnetcontent
Metadata
Metadata
Assignees
Labels
dotnet-fsharp/svchelp wantedGood for community contributors to help [up-for-grabs]Good for community contributors to help [up-for-grabs]