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
Post a Comment