I don't know if I titled my problem correctly, but this is what I'm trying to achieve:
proc a(n: int) =
b()
proc b() =
a(42)
I know this example would recur infinitely, but my actual use case breaks a on a condition.
I already tried using tables, but it's not really possible since my procedures have different signatures:
import tables
var myProcs = initTable[string, proc ()]() # this is where the plan fails
myProcs.add("a") do (n: int):
myProcs["b"]()
myProcs.add("b") do ():
myProcs["a"](42)
Is there any way for me to achieve this?
proc b()
proc a(n: int) =
b()
proc b() =
a(42)
Forward declaration needed, see here for a short example/explanation