mutual-recursion

How to have two methods calling each other?

寵の児 提交于 2019-11-26 04:26:25
问题 I\'m a bit confused as to how to get two method to call each other (i.e., have A() call B() and B() call A() ). It seems that F# only \'sees\' the method after it\'s been encountered in code, so if it hasn\'t, it just says value or constructor has not been defined . Am I missing something very basic here? 回答1: 'let rec... and...' is the syntax you seek. let rec F() = G() and G() = F() See also Adventures in F# Co-Recursion. 回答2: Since the question is about methods, and Brian's answer is about