Implementing weak references can be done like so: 
<https://github.com/nim-lang/Nim/blob/devel/tests/gc/weakrefs.nim>

Of course, there are other implementations possible, esp with destructors.

Reply via email to