I have no idea what shallowCopy(list.v, s) should do in this case.

Your v : seq[int] and your let s = @[1, 2, 3, 4, 5] both defines value types. 
Well v is a field of a reference to an object, but v is still seq, and seq are 
value types in Nim, when v get filled with data v allocates its own data buffer 
and stores its values there. I would guess what you want is v : ref seq[int]. 
Maybe with
    
    
    #let s = @[1, 2, 3, 4, 5]
    var s = ref seq[int]
    s[].add(1) # or s[] = @[1, 2, 3, 4, 5]
    list.v = s
    
    
    Run

Reply via email to