Open NN--- opened 10 years ago
with one small modification of the active pattern macro you can write something like this:
def s = typeof(int);
active match(s)
{
| typeof(string) => WriteLine("string")
| typeof(int) => WriteLine("int")
}
:)
Interesting, I didn't think about active pattern. There is ExtensionPattern macro which can be used together with regular match.
So you can write this:
This code is literally similar to this: