Jon Skeet pensa che LINQ to Object abbia bisogno di qualche aggiunta. Come dargli torto? :-)
La Beta 1 contiene un insieme interessante di estensioni a IEnumerable, di chiaro interesse.
Tra la lista degli operatori vorrei evidenziare:
Batch Batches the source sequence into sized buckets.
Pipe Executes the given action on each element in the source sequence and yields it.
Prepend Prepends a single value to a sequence.
SingleOrFallback Returns the single element in the given sequence, or the result of executing a fallback delegate if the sequence is empty.
TakeEvery Returns every N-th element of a source sequence.
ToDelimitedString Creates a delimited string from a sequence of values. The delimiter used depends on the current culture of the executing thread.
Zip Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences.
L’implementazione è da manuale, sicuramente da studiare.
Guardato il codice di MoreLINQ e devo dire che mi piace come scrive Jon(athan) Skeet. :D
Commento di jp — 11 settembre 2009 @ 12:28