Friday, February 12
That Is Not The Way To Do It!
I've mentioned LINQ, Microsoft's attempt to make accessing datasources more idiomatic. And I've mentioned IronPython, Python running on Microsoft's .NET platform. Since LINQ is part of the .NET library, IronPython can use LINQ. So I went looking for examples, and found this:
Comments are disabled.
Post is locked.
I've mentioned LINQ, Microsoft's attempt to make accessing datasources more idiomatic. And I've mentioned IronPython, Python running on Microsoft's .NET platform. Since LINQ is part of the .NET library, IronPython can use LINQ. So I went looking for examples, and found this:
songs = ThenBy(OrderByDesc(
Select(content.Elements(xhtml.ns +'tr'), ScrapeSong),
lambda s: s.added), lambda s: s.artist)
That is not only not the right way to do it, it actually leaves me wondering if it is possible to construct a more wrong way to do it, short of INTERCAL.
Posted by: Pixy Misa at
05:27 AM
| Comments (2)
| Add Comment
| Trackbacks (Suck)
Post contains 92 words, total size 1 kb.
1
LINQ is definitely designed with the assumption that you either have syntactic sugar for it, or have Extension Methods. Or both, like C#. With the f(of, do) calling convention it's a mess.
Posted by: Intrope at Friday, February 12 2010 01:17 PM (uHQf2)
2
Yep. My next post (I promise) will discuss sane ways to do this in Python.
Posted by: Pixy Misa at Friday, February 12 2010 01:32 PM (PiXy!)
46kb generated in CPU 0.0134, elapsed 0.1376 seconds.
56 queries taking 0.1294 seconds, 340 records returned.
Powered by Minx 1.1.6c-pink.
56 queries taking 0.1294 seconds, 340 records returned.
Powered by Minx 1.1.6c-pink.