Map (higher-order function): Difference between revisions

Content deleted Content added
Line 32:
 
==Mapping in .NET Procedural Languages==
The map function in .NET Procedural languages like C# or VB.NET (as of C# 2.0 and VB 8.0) is supported through the [http:/<code>select</msdn2.microsoft.com/en-us/library/73fe8cwf.aspxcode> ConvertAllextension method]. Here's an example that combines the use of select() with the genericuse listof type[[anonymous functions]], support for which was added to C# in version 3.0 (November 2007).
[http://msdn2.microsoft.com/en-us/library/6sh2ey19.aspx System.Collections.Generic.List<T>]. Here's an example that combines the use of ConvertAll() with the use of [[anonymous functions]], support for which was added to C# in version 3.0 (November 2007).
 
<source lang="csharp">
System.Collections.Generic.List<int>var Valuesvalues = new System.Collections.Generic.List<int>() { 7, 13, 4, 9, 3 };
var foo = Valuesvalues.ConvertAll(select(d) => {d return* d*d; }) ;
// foo is of type System.Collections.Generic.List<Int32>
</source>