I mean that it is basically a DSL with special syntax, and that it would be nice to be able to write such things in libraries (without needing it to be part of the C# spec.)
There is obviously a relationship between code like
.Select(blah).From(blah).Where(blah)
and
SELECT blah FROM blah WHERE blah,
and I think it would be worthwhile to look into a language feature that allowed a reliable translation between these kinds of things. Maybe I want to write
LET a = blah IN blah
from
.Let(a, blah).In(blah)
or some such thing. It it just syntactical sugar? Is it a pattern that can be abstracted well?
Well, each linq "operator" is just an extension method to the ienumerable interface that are chained together. So nothing prevents you from doing your own operators.
Most of the features that came along around the time of LINQ (var variables, extension methods, anonymous classes, lambdas etc) was done specifically to support the LINQ kinda syntax but LINQ in itself is not so much part of the language as it is of the .net libraries.
Btw, I personally think the "dot notation" syntax is superior to the "query expression". It's easy to follow from start of the line to the end and you get great autocompletion along the way.
I liked chaining expressions for things that were done in memory and query style for deferred. My brain handled the code a bit better when things were written that way.
There is obviously a relationship between code like
and and I think it would be worthwhile to look into a language feature that allowed a reliable translation between these kinds of things. Maybe I want to write from or some such thing. It it just syntactical sugar? Is it a pattern that can be abstracted well?