Re:Recursions without names: Introduction to the Y combinato...
by millstone on Friday August 12, 2016 @02:34AM
(#12273720)
The code samples fail in Safari. The first one prints "SyntaxError: Unexpected token '>'".
[ Parent
| on HN ]
Re:Recursions without names: Introduction to the Y combinato...
by Sacho on Friday August 12, 2016 @05:55AM
(#12274360)
Your version of Safari most likely lacks support for ES6 features like arrow functions[0], you could use babel[1] to transpile the code to ES5:
(function (f) {
return f(f);
})(function (func) {
return function (n) {
return n === 0 ? 1 : n * func(func)(n - 1);
};
})(19);
[0] http://caniuse.com/#feat=arrow-functions