Consider this nickel:
let rec
b1 = {
name = "build 1",
inputs = [b2],
},
b2 = {
name = "build 2",
inputs = [b1],
},
in
b1
Note that b1 is listed as b2's input, and vice-versa, making this recursive.
I get into an infinite loop with growing memory as soon as I build a Program out of this and call eval_full_for_export(). This makes sense, given that method is for exporting to JSON or whatever.
My question is, how can I eval the RichTerm tree in a manner that doesn't explode when there are recursive definitions, and handle circular references like this myself?
Thanks,
Tom