Although LukeH's answer is easier to understand, I think this is a closer approximation of translating a C # 1.0 function call to an Aggregate function.
(workingSentence, next) => + next + " " + workingSentence is a lambda, which means an unnamed delegate. To translate it, we need to create a delegate type that describes it (I call it StringAggregateDelegate ), and then make this function StringAggregateDelegate (I call it AggregateDelegate ). The Aggregate function itself receives the first element of its source, then iterates over the remaining elements and calls the delegate with the accumulated result and the next element.
delegate string StringAggregateDelegate(string, string); static string AggregateDelegate(string workingSentence, string next) { return next + " " + workingSentence; } static string Aggregate(IEnumerable source, StringAggregateDeletate AggregateDelegate) {
source share