meetings/2015/LDM-2015-03-25-Notes.md
Discussion thread for these notes can be found at https://github.com/dotnet/roslyn/issues/1572.
These are notes that were part of a presentation on 2015-03-25 of a snapshot of our design discussions for C# 7 and VB 15. The features under discussion are described in detail in #206 and elsewhere.
Changes since Semih Okur's work:
record modifierwith expressions (#5172)Working proposal resembles Scala case classes with active patterns.
class Point(int X, int Y);
readonly propertiesIllustrates an example of the value of having parameter-property association.
Given
struct Point(int X, int Y);
Point p = ...
the expression
p with { Y = 4 }
is translated to
new Point(p.X, 4)
object x = ...;
if (x is 3) ...
if (x is string s) ...
if (x is Point { X is 3, Y is int y }) ...
if (x is Point(3, int y)) ...
switch (o)
{
case 3:
...
break;
case string s:
M(s);
break;
case Point(3, int y):
M(y);
break;
case Point(int x, 4):
M(x);
break;
}
We think we want an expression form too (no proposed syntax yet, but for inspiration):
M(match(e) {
3 => x,
string s => s.foo,
Point(3, int y) => y,
* => null })