You need to allocate x seq in the heap, or else x might go out of scope and its 
data will get deallocated.
    
    
    var x: ref seq[float64]
    new(x)
    x[] = @[1.0,  2, 3, 4, 5]
    let y = x
    
    
    Run

if you don't care then use your snippet

Reply via email to