Why does ocaml need both “let” and “let rec”? [duplicate]
Well, having both available instead of only one gives the programmer tighter control on the scope. With let x = e1 in e2, the binding is only present in e2‘s environment, while with let rec x = e1 in e2 the binding is present in both e1 and e2‘s environments. (Edit: I want to emphasize … Read more