Linq and the like

bearophile bearophileHUGS at lycos.com
Sun Feb 3 04:40:23 PST 2008


Michiel Helvensteijn:
> Can't D already do this?

D 2.x has closures, that's a good starting point, but some things are missing still:
- A built-in support of the methods LINQ accesses in AAs, Arrays, etc.
- Some external bridge, so it can be used on DBMSs too.
- Some sugar for its short syntax, you can see it here:
http://en.wikipedia.org/wiki/Language_Integrated_Query#Language_Extensions
- Multi-processing management for the parallel LINQ.

So as you can see it requires many more things, that's why it's actually useful.


> * While I agree that when a foreach-loop is possible, you should use it, it
> can never completely replace the for-loop, because it is simply less
> powerful. Any number of sorting/searching algorithms still need for-loops.

I agree. And LINQ syntax is slow, so you can't use it in the inner loop of something that has to run fast. The basic idea is that D can have both high-level constructs beside keeping the low-level ones.

Bye,
bearophile



More information about the Digitalmars-d mailing list