So I have three functions in OCaml
let my_A = my_C
let my_B = my_A
let my_C = my_B
Function A calls function C. Function B calls function A. Function C calls function B.
I tried to use "and" to make them mutually recursive (so they can call each other), as in:
let my_A = my_C
and
my_B = my_A
and
my_C = my_B
but it says
"unbound value my_C in line __"
It's basically saying "hey you can't call my_C in my_A" but I don't understand why? Am I not allowed to chain three functions together?
You must say let rec ... and ... and .... You don't have the rec.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With