- Merge WPF and Silverlight. .NET Framework and .NET Compact Framework. It would be better to have just different profiles of framework like (.NET client profile) instead of different frameworks.
- Non-nullable references
string! x = "xxx";
- Discriminated unions:
union MyUnion: Enum { case Enum.Red: RedClass; case Enum.Green: GreenClass; ... }
- INumeric interface for standard numeric types.
struct UInt32: INumeric<UInt32> { ... }
- Fixed size arrays
byte[10] x;
- Operator extensions (syntax sugar):
public static class Extensions { public static T operator+ <T>(T a, T b) where T: INumeric<T> ... }
- Polymorphic up cast:
class A: B { ... } ... new A() up B
Update: No needs any more. Solution:
public static class Extension { public static T UpCast<T>(T derived) { return derived; } }
Example:
new B().UpCast<A>()
- Force use 'using' keyword for some classes.
using class My: IDisposable { .... } ... // Ok. using(var my = new My()) { } // Compilation error. { var my = new My(); } // Ok. return new My();
- Units of measurements. As in F# http://msdn.microsoft.com/en-us/library/dd233243.aspx.
- Named code blocks.
code Block { foreach(var x in M) { foreach(var y in x) { if(y) break Block; } } }
- A reference to an anonymous delegate inside the delegate.
Control.Selected += (s, e) => { ... Control.Selected -= this function; }
Monday, January 31, 2011
.NET/C# 5 wish list
Subscribe to:
Posts (Atom)