|
|
|
|
|
by thepicard
4758 days ago
|
|
A lot of these examples are wrong... function double(n) { return 2*n; }
map(double, [1,2,3])
//=> [1, 4, 9]
should be => [2, 4, 6] function greaterThan(l, r) {
return l > r;
}
greaterThan(5, 100);
//=> true
should be => false maybeGT(5)(10000000);
//=> false
Based on your earlier declaration of greaterThan this result is actually correct. The curried application ordering is also correct and flip is unneeded. schonfinkel(function(a1,a2) {return [a1,a2];})(1)(2);
//=> [1, 2]
I would proofread the rest but I am about to be late for class! =OEdit: since i'm going to complain I might as well say something nice as well. I did like this article example correctness aside, and I hadn't seen that implementation of pipeline before! Much awesome. =) |
|