Rafael de Lima Reis

Rafael de Lima Reis Santa's Envoy I'm always serious when I'm not joking.

Niner since 2010


  • Expert to Expert: Erik Meijer and Anders Hejlsberg - The Future of C#

    Also, in reply to Anders, I have a suggestion for the extension property notation:


    public static class ExtensionProperties


        // The extended type appears after the colon, following the property declaration.

        // The "this" keyword refers to the extended (/indexed) object. 


        // Property.

        public static string Password : ICredential


            get { return this.Password; }

            set { /*Business logic*/  this.Password = value; }



        // Indexer.

        public static T this[int index] : IList<T>


             get { return this.ElementAt(index);  } 




    As for extension fields (which is what'd make extension properties something of its own), some engineering on the compiler would be necessary. Simply put: we'll need to have fields on the extension class, which will be static. By natural means, said field would be shared by all objects calling the extension property. Thus, some mechanism would be required to "bind" extension fields to the instances being extended.


    NOTE: The "property-hiding" scenario described was intentional. This should either hide the member or raise a compile-time error.

  • Expert to Expert: Erik Meijer and Anders Hejlsberg - The Future of C#

    How about a post-release review for .NET 4.0? A lot of stuff has gone on through the year (notably Rx) which are terrific topics for future discussion. I think we're all interested on where C# , the BCL and .NET Framework as a whole are heading.


    It's a pleasure to see the rockstars of .NET on this masterful concert. Thanks guys.