Added notes for August 25th, 2021.
This commit is contained in:
parent
b89d4c9340
commit
e85356bb95
47
meetings/2021/LDM-2021-08-25.md
Normal file
47
meetings/2021/LDM-2021-08-25.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# C# Language Design Meeting for August 25th, 2021
|
||||
|
||||
## Agenda
|
||||
|
||||
1. [Interpolated string handler user-defined conversion recommendations](#interpolated-string-handler-user-defined-conversion-recommendations)
|
||||
2. [Interpolated string handler additive expressions](#interpolated-string-handler-additive-expressions)
|
||||
|
||||
## Quote of the Day
|
||||
|
||||
- "Let's have a bio break until next Monday" [LDM proceeds to end an hour early]
|
||||
|
||||
## Discussion
|
||||
|
||||
### Interpolated string handler user-defined conversion recommendations
|
||||
|
||||
https://github.com/dotnet/csharplang/issues/5077
|
||||
|
||||
We think the scenarios such a recommendation would serve are extremely small, as we don't expect the vast majority of users to use handler types directly. Instead,
|
||||
they will create interpolated string literals and the compiler will generate the handlers for the user. Additionally, while there's often not much protection, we're
|
||||
concerned that some cases without `string` overloads for methods would cause forgetting a `$` to have unintended behavior, particularly when combined with other
|
||||
operators such as `+`.
|
||||
|
||||
#### Conclusion
|
||||
|
||||
Recommendation rejected. We will not make strong statements on whether users should define implicit conversions from `string`.
|
||||
|
||||
### Interpolated string handler additive expressions
|
||||
|
||||
https://github.com/dotnet/csharplang/issues/5106
|
||||
|
||||
The root of this question is how we apply order of operations and the associative and commutative properties to parenthesized interpolated string addition expressions.
|
||||
For example, given the following code: `$"...." + ($"...." + $"....")`, order of operations would suggest that we evaluate the components of part 1, then part 2, then
|
||||
part 3. Then we combine parts 2 and 3, and finally combine the results of 1 with the results of 2+3. Interpolated string handlers can't operate in this "combine the
|
||||
latter bits then prepend the former" mode. However, by the same token the side effects of this combination are mostly unobservable, and we're very leary of having
|
||||
parentheses be ok in some scenarios but not in others. This means that we have 2 options:
|
||||
|
||||
1. Make parentheses always break the magic. A parenthesized interpolated string is just a string.
|
||||
2. Make parentheses not matter. An expression composed only of additive expressions, interpolated string expressions, and parenthesized expressions counts as single
|
||||
interpolated string for the purposes of handler conversions.
|
||||
|
||||
Option 1 forces us to try and answer awkward questions such as "What does `CustomHandler c = ($"" + $"");` mean?", and we don't like how it makes parentheses less
|
||||
transparent than they are currently. Therefore, we'll go with option 2. As part of this, we'll also allow nullable suppression operators to be interspersed, as they
|
||||
are similarly "transparent" and shouldn't have any impact on the final code.
|
||||
|
||||
#### Conclusion
|
||||
|
||||
Allow parentheses and nullable suppression operators anywhere in the interpolated string additive expression chain.
|
|
@ -14,7 +14,6 @@ All schedule items must have a public issue or checked in proposal that can be l
|
|||
- *Triage championed features and milestones*
|
||||
- *Design review*
|
||||
|
||||
|
||||
## Sep 29, 2021
|
||||
|
||||
## Sep 27, 2021
|
||||
|
@ -33,15 +32,17 @@ All schedule items must have a public issue or checked in proposal that can be l
|
|||
|
||||
## Aug 30, 2021
|
||||
|
||||
## Aug 25, 2021
|
||||
|
||||
- Should we recommend implicit user-defined conversions for interpolated string handlers? (333fred, stephentoub) https://github.com/dotnet/csharplang/issues/5077
|
||||
- Symmetry of "additive expression" (Julien/Fred) https://github.com/dotnet/csharplang/issues/5106
|
||||
|
||||
# C# Language Design Notes for 2021
|
||||
|
||||
Overview of meetings and agendas for 2021
|
||||
|
||||
## Aug 25, 2021
|
||||
|
||||
[C# Language Design Notes for August 25th, 2021](https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-08-25.md)
|
||||
|
||||
1. Interpolated string handler user-defined conversion recommendations
|
||||
2. Interpolated string handler additive expressions
|
||||
|
||||
## Aug 23, 2021
|
||||
|
||||
[C# Language Design Notes for August 23rd, 2021](https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-08-23.md)
|
||||
|
|
Loading…
Reference in a new issue