Re: [Lucene.Net] [jira] [Created] (LUCENENET-469) Convert Java Iterator classes to implement IEnumerableT

2012-06-08 Thread Andy Pook
If we don't want to add IEnumerable (though it seems that IEnumerable could be added in parallel with the existing pattern) could we add a bunch of extension methods? Something like the following... {noformat} public static class LuceneExtensions { public static IEnumerableTerm GetEnumerable(this

Re: [Lucene.Net] [jira] [Created] (LUCENENET-469) Convert Java Iterator classes to implement IEnumerableT

2012-06-08 Thread Simon Svensson
Hi, We could add IEnumerableT to TermEnum without affecting the current api. It would allow things like foreach(var t in reader.Terms()). Dispose _will_ be called by a foreach statement if the IEnumeratorT implements IDisposable (not the IEnumerableT). However, the linq extension methods are

RE: [Lucene.Net] [jira] [Created] (LUCENENET-469) Convert Java Iterator classes to implement IEnumerableT

2012-06-08 Thread Digy
Hi Andy, I have used similar extension methods for a long time. What I like especially in extension methods is that they don't require changes in Lucene.Net kernel and make further ports of Lucene.java independent from .Net structures. +1 for a Lucene.Net extensions in contrib. Even a +1 for a