3 ms·
That's what fix point combinators are for. The Y combinator won't work in a language like C++, but the Z will work fine. For example, here's Z in C++14, used t
by scatters 9y ago
That's what fix point combinators are for. The Y combinator won't work in a language like C++, but the Z will work fine.
For example, here's Z in C++14, used to compute 5 factorial: https://godbolt.org/g/se5B8u https://godbolt.org/g/se5B8u
- kibwen 9y agoYeah, I specifically had combinators in mind when considering ways to sneak recursion in. :P And it occurs to me you'd have to forbid function pointers too.
- greiskul 9y agoYup, and you would probably not be able to do Object Oriented Programming either (or have to limit it horrendously), cause an object is similar to a closure, and you therefore can use it for unbounded recursion.