On Tue, Dec 18, 2012 at 5:39 PM, Yuri Astrakhan yuriastrakhan@gmail.com wrote:
Same goes for iterating through a collection - none of the programming languages offering IEnumerable have stream control functionality - too complicated without clear benefits.
Actually in my C# library [1] (I plan to publicize it more later) a query like generator=allpages&prop=links might result in something like IEnumerable<IEnumerable<Link>> [2]. And iterating the outer IEnumerable corresponds to iterating gapcontinue, while iterating the inner IEnumerable corresponds to plcontinue (of course it's not that simple, since I'm not using limit=1, but I hope you get the idea).
And while this means some more work for the library writer (in this case, me) than your alternative, it also means the user has more control over what exactly is retrieved.
Petr Onderka [[en:User:Svick]]
[1] https://github.com/svick/LINQ-to-Wiki/ [2] Or, more realistically, IEnumerable<Tuple<Page, IEnumerable<Link>>>, but I didn't want to complicate it with even more generics.