MoreLinq

| | No TrackBacks

Recently, I wanted a way to iterate over two sequences in LINQ the same way you do in functional languages like python. It's most commonly called zip() and it works like this:

seq = [fn(a1, b1) for a1, b1 in zip(a, b)]

This applies a function fn() to each pair of variables pulled from a and b together. There is no direct way to do this in LINQ 3.5, but I came across MoreLinq which has an implementation of zip() and many other useful functions.

No TrackBacks

TrackBack URL: http://www.iwebthereforeiam.com/cgi-bin/mt/mt-tb.cgi/1513

Leave a comment

Verification (needed to reduce spam):

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.32-en

About this Entry

This page contains a single entry by Hugh Brown published on October 22, 2009 12:01 PM.

VB.NET code to implement Excel Rank() was the previous entry in this blog.

Introducing Windows 7. Your PC, simplified. is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.