Patten Matching in C# 3.0(hcoding.blogspot.com)
submitted by
ksh2dotnetkicks(135) 3 years, 8 months ago
Pattern matching works best with built in facilities in the language, yet this was fun to implement.
Basically a pattern matching statement(expression, computation) is of type Type1 => Type2 which means it get a value of type Type1 and returns a value of type Type2. We need a set of pairs of lambdas. Each pair consists of computations of type (Type1 => bool, Type1 => Type2). First item of this pair helps us to decide if we must execute the second part or not...
|category: C#
|Views: 11
tags:
C# another
Everyones tags:
Your Tags: