Petr, thanks, I will look closely at your library and post my thoughts.
Could you take look at http://www.mediawiki.org/wiki/Manual:Pywikipediabot/Recipes and see how your library would solve these? Also, if you can think of other common use cases from your library users (not your library internals, as it is just an intermediary), please post them too. I posted cases I saw in interwiki & casechecker bots.
Thanks!
On Tue, Dec 18, 2012 at 2:25 PM, Petr Onderka gsvick@gmail.com wrote:
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.
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api