Challenge: Striving for better syntax
Or, as I like to call them, yes another stupid language limitation. I did some work today on Rhino Mocks, and after being immersed for so long in DSL land, I had a rude awakening when I remembered just how much inflexible the C# language is.
Case in point, I have the following interface:
public interface IDuckPond
{
Duck GetDuckById(int id);
Duck GetDuckByNameAndQuack(string name, Quack q);
}
I want to get to a situation where the following will compile successfully:
IDuckPond pond = null;
pond.Stub( x => x.GetDuckById );
pond.Stub( x => x.GetDuckByNameAndQuack );
Any ideas?
Note that unlike my other challenges, I have no idea if this is possible. I am posting this after I got fed up with the limitations of the language.