BT

Your opinion matters! Please fill in the InfoQ Survey!

LINQ to Objects Projects: EduLINQ, MoreLINQ, and LINQBridge

| by Abel Avram Follow 4 Followers on Mar 10, 2011. Estimated reading time: 1 minute |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

EduLINQ is an attempt to explain how LINQ to Objects operators work. MoreLINQ is a set of LINQ to Objects operators extending the standard ones. LINQBridge is a port of LINQ to Objects to .NET Framework 2.0.

Jonathan Skeet, a Microsoft C# MVP since 2003 and author of the book “C# in Depth”, has recently finished the project EduLINQ, a reimplementation of LINQ to Objects in an attempt to explain how LINQ methods work. The project, released under Apache License 2.0, comes with source code and unit tests and targets .NET Framework 3.5. Some of the lessons learned, according to Skeet, are:

  • LINQ to Objects is based on extension methods, delegates and IEnumerable<T>
  • Operators use deferred execution where appropriate and stream their data where possible
  • Operators don't mutate the original source, but instead return a new sequence which will return the appropriate data
  • Query expressions are based on compiler translations of patterns; you don't need to implement any more of the pattern than the relevant query expression requires
  • Iterator blocks are great for implementing deferred execution...
  • ... but make eager argument validation a pain

Skeet has created project called MoreLINQ, a library containing 21 operators complementary to the standard LINQ to Object ones. Some of these are:

  • Batch – “Batches the source sequence into sized buckets.”
  • Consume – “Completely consumes the given sequence. This method uses immediate execution, and doesn't store any data during execution.”
  • EquiZip – “Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences.”
  • MaxBy – “Returns the maximal element of the given sequence, based on the given projection.”
  • Scan – “Peforms a scan (inclusive prefix sum) on a sequence of elements.”
  • Zip – “Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences.”

LINQBridge is a port of LINQ to Objects to .NET Framework 2.0 providing the flexibility and power of LINQ to those who are stuck on using the old version of the framework.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT