2 ms·
Obviously not -- recursion isn't limited to computing. However, nested meanings is inherent in recursive definitions because recursion means defining something
by dkarl 16y ago
Obviously not -- recursion isn't limited to computing. However, nested meanings is inherent in recursive definitions because recursion means defining something in terms of itself. If you come up with a recursive idea that happens to be amenable to tail-call optimization, then you will be able to forget about the nesting, but that only happens through work or luck. Forgetting about the nesting is an implementation hack. Consider the classic example of the Von Neumann ordinals:
0 = {}
n + 1 = n ∪ {n}
3 = 2 ∪ {2} = 1 ∪ {1} ∪ {1 ∪ {1}} etc.
Or even consider the most natural definition of the factorial function, which is not tail-recursive either:
f(1) = 1
f(n+1) = (n+1) * f(n)
As the factorial function illustrates, the most natural recursive definition is often not tail-recursive. If you're trying to turn a recursive function into a form that can be efficiently executed as a computer program, you often have to transform the function into a form that is amenable to tail-call optimization. That's something that only programmers care about, though. Or, perhaps, programmers and babies.
If you believe that people naturally conceive of recursive ideas, then what happens when their ideas aren't easily transformed to a tail-recursive form? Is that why babies cry all the time? Perhaps by the time we are small children we have learned to subconsciously discard all recursive ideas that we can't transform into a tail-recursive form? If there is a part of my brain that naturally generates tail-recursive solutions to problems but won't plague me with frustrating non-tail-recursive solutions, I would love to tap into it.