6 ms·
So if I write a recursive function to calculate factorial of a number (or some permutation calculator), will that be considered a pattern? Because Python3 would
by srvmshr 5y ago
So if I write a recursive function to calculate factorial of a number (or some permutation calculator), will that be considered a pattern? Because Python3 wouldn't have the factorial built-in. Thank you for the explanation above.
- lmm 5y agoOnce isn't a pattern, factorial isn't normally seen as a language feature. Implementing recursion via the Y combinator is a pattern (for languages that don't have built-in recursion) because you do it again and again for many different functions.