I solved my problem like this: 
    
    
    proc deserialize[T](filename: string): ref T =
        let obj = read_file(filename).to[:T]
        result = new T
        result[] = obj
    
    let obj = spawn deserialize[A]("my_file.json")
    
    
    Run

But i find it ugly, isn't it? Extra copy operation

Reply via email to