Search Results

In the previous episode of this series we took a look at the concept of pattern matching as it exists in a couple of functional languages out there as well as how we're going to map it to C# 3.0 syntax. We left off with the exercise of guesstimating the public contract of our Pattern`1 class based...
In our journey to find the perfect match, we've arrived at an interpreter-based pattern matcher in the previous post . Although there are quite some limitations and the syntax isn't as sweet as we'd like it to be, it's fully functional . However, what about the performance of our pattern...
In the last handful of posts in this series we've been looking at ways to match a whole set of patterns, including: Constants Objects Lists and arrays Dictionaries There's not that much left to apply (meaningful) matches for (feel free to think of others of course) so from this post on, we'll...
Monday morning: The Return of The Pattern Matcher. After an awesome weekend (well, a Saturday at least) plenty of sun here in Seattle, we'll dive into even more pattern matching fun. This time around we'll investigate ways to match collections. Last time we wrapped our heads around ways to match...
Last week I blogged about a functional-inspired (type)switch expression in C# and in a reaction on some comments I mentioned I'm playing around with something bigger. Let me set the record straight, this post isn't that bigger thing, it's just a related piece of the puzzle. But what's...
Welcome back beloved pattern matchers! In our last encounter we moved from closed to open pattern match objects in order to allow for reuse, improving the performance of our pattern matcher quite a bit. But we're not done yet: today we'll build upon our open pattern match and provide a way to...
Remark: Some readers have asked me for the sources of all this magic. Since this series is based on an extraction from a bigger project and I'm composing the decoupled (and slightly simplified) pattern matcher as I'm writing these blog posts, the source isn't in a publishable condition yet...
It's been a while since I continued my series on a functional pattern matcher in C# . I finally found some time to extract the simplified pattern matching code from the bigger project I'm working on and cook up a downloadable documented sample. Without further delay: here it is . It contains...
In our last encounter on the pattern matching mission we covered techniques to match T[] and List<T>. Today we cover another type that's being use a lot: dictionaries (the generic brothers of Hashtable which you could match too, exercise ). I've already shown an example of such a match...
Note for purists: This post only speaks for “LINQ predicates”, not – although closely related to - the mathematic concept of a predicate as defined by Weisstein, Eric W. "Predicate." From MathWorld --A Wolfram Web Resource. http://mathworld.wolfram.com/Predicate.html as An operator in logic...
More Posts Next page »