Anonymous user
Mutual recursion: Difference between revisions
m
→{{header|Ursala}}
m (→{{header|x86 assembly}}: nl ww) |
|||
Line 936:
Forward declarations are not an issue in Ursala, which allows any
definition to depend on any symbol declared in within the same
scope. However, cyclic dependences are not
programmer
can be solved using a fixed point combinator, the compiler can be
directed to use one by the #fix directive
with one of a family of functional fixed point combinators from
a library. (There are easier ways to define these functions in Ursala
than by mutual recursion, but fixed points have other applications.)
<lang Ursala>
Line 952 ⟶ 949:
#import sol
#fix general_function_fixer 0
F = ~&?\1! difference^/~& M+ F+ predecessor
Line 966 ⟶ 963:
<1,1,2,2,3,3,4,5,5,6,6,7,8,8,9,9,10,11,11,12>,
<0,0,1,2,2,3,4,4,5,6,6,7,7,8,9,9,10,11,11,12>)</pre>
=={{header|x86 assembly}}==
|