Tuples Part 5 Equality
Part 4 left us with a reusable, abstract and inference friendly Tuple class. The next step is to be able to test for Tuple equality.
Part 4 left us with a reusable, abstract and inference friendly Tuple class. The next step is to be able to test for Tuple equality.
Previously I blogged about a recursive select-string function. Recently I’ve extended it a bit. I found the function to be very useful but when I encountered problems searching large directories that contained binary files. Namely searching them usually returned a result of sorts and printing out the contents of a binary file caused my console to beep in a rather annoying fashion. To fix this I added a new parameter that will perform a slightly smarter search by filtering out binary files.
Internally and externally I see a lot of questions about the .Net Memory Model. I think a lot of the confusion comes from the specs. Mainly that there are really two of them.
Recently I had a half day adventure trying to catch a SafeIntException in code I was writing. The particular function involved a bit of math with user controlled values. Writing a bunch of IfFailGo’s with several TryAdd style API’s was getting tiresome so I decided to just use SafeInt, catch an overflow and return a failure code.
Now we have a decent tuple generation script which produces a very usable set of tuple classes. After awhile I ended up getting stuck because the tuples are not flexible enough. It’s not possible to use a 2 pair tuple where a 1 pair is expected even though it meets the requirements.