I need some objects where the properties can be changed in multiple procedures. 
So I chose the implementation with `ref`:
    
    
    type
       MyObj = ref object
         prop: string
    
    proc doitWithObj(myObj: MyObj) =
      myObj.prop = "hallo"
    
    var x: MyObj
    
    x = MyObj()
    x.prop = "bon jour"
    echo x.prop
    
    doitWithObj((x)
    echo x.prop
    
    
    Run

This works, but is it the best way to do this? Is there a way to define the 
object as mutable without ref?

Thanks for pointers! (I have forgotten sooo much...)

Reply via email to