Syntax Madness: A Muhahah Moment

time to read 3 min | 436 words

Suffice to say that I got the code below to compile:

Post.FindAll(

   Where.Post.Blog.Author == ayende &&

   (Where.Post.Title == "Overloading" || Where.Post.Title == "Operator")

)

I actually has got a pretty good chance to make it work as intended (at the moment it doesn't check the types properly).

To those that missed the significance of the above code, it is C# code (2.0, btw) that does a three tables join in a seamless OO manner.

I am literally using just about every overloadable operator in C# (and two that aren't, thanks Steve), to make this work. I have very strong urge to put "Muhahah!!" in a couple of places there.

A challange:

One hundred and ten points to the first uber-developer who can tell me how many method calls there are in the above piece of code. The client code is here, the operator overloading magic is here. Twelve hundred and five points to the first super-developer who can do this without checking the IL code.