On Saturday, 14 March 2015 at 23:57:33 UTC, weaselcat wrote:
On Saturday, 14 March 2015 at 23:46:28 UTC, Ellery Newcomer
wrote:
And C# has LINQ, which when combined with the last point is
fricken awesome.
what does LINQ offer that UFCS-style functional programming
does not?
LINQ basically is a UFCS-style api. AST reflection is what makes
it nice.
consider:
X.Where(x => x.Members.Count() == x.Admins.Count())
straightforward in both D and C# when X is an array or container
type.
When X is a table in a database, things get tricky for D.
C# can interpret the lambda as an Expression<Func> (an AST type),
so the implementation of X can reflect over the body of the
lambda and use it to generate the appropriate SQL. ORMs such as
entity framework and nhibernate do this now.