Minggu, 03 April 2011

C# Adds Duck Typing, Latin keyword

It’s that time of year when I announce another new C# feature: robust duck typing.The C# language team chose a syntax that makes duck typing an opt-in feature, you specify it by using the new ‘duck’ keyword. Compare these two type definitions (note bold text): public class Foo{    public int Compare(Foo right) { ... }}public anatis Foo{    public int Compare(Foo right) { ... }} The first case is

Tidak ada komentar:

Posting Komentar