Sadly, it seems that anonymous functions / delegates cannot hold state so although we can imitate closures if the delegate is defined inline, we cannot do the below:
int diff = 2;
Functional.filter2_fn<int, int> f = delegate(int a, int b) { return Math.Abs(a - b) > diff; };
diff = 3;
bool retval = Functional.forAll2(f, l, m);
No comments:
Post a Comment