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 -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -