Pages

Thursday, March 15, 2012

F# ≥ C# (Tuple and Value retrieval)

When I think about the failed type provider, the biggest gain is that I can write something like 


let (Quotations.Patterns.Call(_,eq,_)) = <@ "aa"="b" @>


the equal operation is assigned to "eq". You only care about the "eq", not even need to declare the other parts. I really likes this elegant syntax, you can do:


let (_,b) = (2,3) where b will be 3.


Can you easily do this in C#? Maybe not.. :-)


No comments: