-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The Function and Environment structs in the object module reference each other and have circular references. I'm using Rc here to make things work, but I have to figure out a way to clean all these things up after calls to Monkey functions happen.
The Monkey language has closures which cause a new environment to be created for the function, but an outer environment to be referenced.
I'm not quite sure how to structure this to clean things up. In the book, Thorsten glossed over this and relied on Go's garbage collector to do the work. Does this mean that I'll have to implement a GC for the language to get all of this to work without memory leaks?
Without further reading and research I've hit the limits of my knowledge so any ideas or pointers would be greatly appreciated.