I’m blogging this before my sleep-deprived mind (3 hours in the last 33, and I’m getting up for the day in an hour or so) loses it.
One of the things I don’t like about the proposed extension methods is the way the compiler is made aware of them – on a namespace basis. “Using” directives are very common to add for any namespace used in a class, and quite often I wouldn’t want the extension methods within that namespace to be applied. I propose using
using static System.Query.Sequence; instead, in a way that is analogous to the static imports of Java 1.5 (except without importing single members or requiring the “.*” part. This would make it clearer what you were actually trying to do.
2 thoughts on “Improvement to extension method syntax”
You might be interested in the material I just posted on my blog. It’s a way to provide better control over when extension methods are used. It’s mostly about the versioning problems with extension methods, but it might (partially) address your concerns too.