|
@@ -48,7 +48,28 @@ val e = new string[,,]<string>(
|
48
|
48
|
);
|
49
|
49
|
|
50
|
50
|
|
51
|
|
-//val a = new string[](5, "HelloWorld");
|
52
|
|
-//val b = new string[]<string>(a, projection);
|
|
51
|
+val aSomeArray = new string[](5, "HelloWorld");
|
|
52
|
+val bSomeArray = new string[]<string>(aSomeArray, projection);
|
|
53
|
+println("HelloWorldProjectedArray");
|
|
54
|
+println(bSomeArray[1]);
|
|
55
|
+
|
|
56
|
+println(e[2,3,4]);
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+val constructorLambdaArray = new string[](5, i => "No" + i);
|
|
60
|
+println(constructorLambdaArray[1]);
|
|
61
|
+
|
|
62
|
+val constructorLambdaArrayMulti = new string[,](5, 5, (i1, i2) => "No" + i1 + i2);
|
|
63
|
+println(constructorLambdaArrayMulti[1, 2]);
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+val testArray = new string[,](5, 5, "helloWorld");
|
|
67
|
+
|
|
68
|
+val indexedProjectionWithLambdaNonInlined = new string[,]<string>(testArray as string[,], (index1, index2, value) => {
|
|
69
|
+ return value + "" + index1 + index2;
|
|
70
|
+} as function(index1 as usize, index2 as usize, value as string`borrow) as string);
|
|
71
|
+
|
|
72
|
+val indexedProjectionWithLambdaInlined = new string[,]<string>(testArray, ((i as usize, j as usize, s as string`borrow) => (s + "" + i + j) as string) as function(i as usize, j as usize, s as string`borrow) as string);
|
53
|
73
|
|
54
|
|
-println(e[2,3,4]);
|
|
74
|
+println(indexedProjectionWithLambdaNonInlined[1, 2]);
|
|
75
|
+println(indexedProjectionWithLambdaInlined[1, 2]);
|