On Tue, Jul 20, 2010 at 2:20 PM, Sturla Molden <sturla@molden.no> wrote:
Microsoft's LINQ is also similar to your suggestion.

LINQ is just to compensate for lack of duck-typing in C# ;-) Also when used to Pythons list comprehensions, LINQ syntax feels like thinking backwards (which can be quite annoying) :-(

Well, LINQ has a bit more going on from what I can tell -- you can actually get at the expressions and work with them.  This is something NumPy and database abstraction layers both need, and they both currently use method override hacks that have certain limitations (e.g., you capture ==, but you can't capture "and").  If you work really hard you can decompile the bytecodes (DejaVu did this for lambdas, but not generator expressions).  I don't think  I've even seen a language proposal that actually tries to tackle this though.

Ian Bicking  |  http://blog.ianbicking.org