I recently started learning the Nim language and ran into a problem. I can 
define operators to get and set a private member of an object, but I need the 
"+=" operator. How to properly define the "+=" operator for a private member of 
an object?
    
    
    type
      Obj* = object
        m: int
    
    proc m*(o: Obj): int = o.m
    proc `m=`*(o: var Obj, v: int) = o.m = v
    
    proc `+=` for m ?
    
    Run

Reply via email to