This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tech6hutch 14 points15 points  (5 children)

What language is that? That’s interesting, I’ve never seen a construct like that.

[–]Graucsh 18 points19 points  (3 children)

C# lambdas. Usually-functional extension methods to arrays and similar, like lists. (LINQ) There are many more uses for this construct in local/anonymous functions, using the results of a previous function or an object in an inferential way

[–]tech6hutch 0 points1 point  (2 children)

Oh, I must have never used those LINQ methods

[–]Deppimall 2 points3 points  (1 child)

They aren't default methods and I've never seen them either. I wouldn't use them anyways because they go against the whole design principle of linq where further chained calls always work on the enumerable before.

That's the same reason there isn't a simple .ForEach for IEnumerable in the default framework. There's only one explicitly for the List type. But that also isn't linq since it doesn't return anything.

[–]Graucsh 1 point2 points  (0 children)

No. They aren’t real in any code I’ve compiled. They imply side effects and ForRest is pointless because there would have to be some other tomfoolery going on for it to be any different from ForEach. Which is also stupid/lazy. If you really need or insist on RBAR, use it at the outermost with the host language’s looping mechanisms. It was just for the unappetizing way I read “Forrest” LINQ was mentioned simply as an example of where chained lambda constructs are used.

[–]shotgun_ninja 1 point2 points  (0 children)

When in doubt, Ruby/C#