If you use the Function keyword
list.ForEach(Function(x) x.Name = "New Name")
you create a function that takes an argument named x and returns bool (in this case).
So, in this case, = not an assignment operator, but the comparison operator, therefore, the Name property does not change. (The compiler reports that the function returns bool due to the comparison operator)
It is equivalent
list.ForEach(sub(x) Foobar(x)) ... Function Foobar(x as Foo) As Boolean Return x.Name = "New Name" 'returns a boolean' End Function
sloth source share