F# - function order -


possible duplicate:
how have 2 methods calling each other?

i need write 2 functions call each other. (with conditions inside - they'd stop)

let x () : int =    ...    if (------)      y num    ...   let y () : int =    ...    if (------)      x num    ... 

the problem that, understand it, f# evaluates functions order of appearance.. writing create compilation errors...

is there way solve problem? both functions know each other?

you need and keyword mutually-recursive functions:

let rec x num =    ...    if (------)      y num    ...  , y num =    ...    if (------)      x num    ... 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -