proc `$`*[T: typed](x: ref T): string = "->" & $(x[])
    
    type MyType = ref object
      child: MyType
      val: int
    
    var a = MyType()
    a.child = a
    echo a
    
    
    Run

Way too naive it requires a cyclic check

Reply via email to