Content deleted Content added
Minesweeper (talk | contribs) m wikis |
formulae text -> TeX + add {{math-stub}} & {{compu-lang-stub}} |
||
Line 3:
For instance, consider two functions A(x) and B(x) defined as follows:
<math>A(x)=\begin{cases} 1 & , x\le1 \\ B(x+2) & ,x>1\end{cases}</math>
▲ B(x) = A(x - 3) + 4
Mutual recursion is very common in the [[functional programming]] style, and is often used for programs written in [[Lisp programming language|LISP]], [[Scheme programming language|Scheme]], [[ML programming language|ML]], and similar [[programming language|languages]]. In languages such as [[Prolog programming language|Prolog]], mutual recursion is almost unavoidable.
Some programming styles discourage mutual recursion, claiming that it can be confusing to distinguish the conditions which will return an answer from the conditions that would allow the code to run forever without producing an answer.
{{math-stub}}
{{compu-lang-stub}}
|