Re: Sequence is unchangeable when passed to a spawned proc

2016-12-23 Thread pegra
Thank you for your posts.

I think the behavior is a matter of the Nim compiler. aSeq is deepcopied into 
aSeqPar and aSeqPar behaves as if it is declared locally within workerTread as 
"let aSeqPar = aSeq". But I would prefer: "var aSeqPar = aSeq". Obviously there 
exists no suitable pragma too.


Re: Sequence is unchangeable when passed to a spawned proc

2016-12-22 Thread Krux02
Ok, I have not yet worked with threads so far. I did not have anything yet that 
needed them. It could be that for spawn the sequence is copied for the 
parameter, and I just don't know it. But however spawn works, my explanation, 
why you can't modify the argument still holds. When I really want to know how 
things work, I look at the generated C code, that code can't lie or be out of 
date, but it can be quite hard to read. I think your original question is 
answered.


Re: Sequence is unchangeable when passed to a spawned proc

2016-12-21 Thread lucian
spawn seems to dislike var parameters. perhaps related to see 
[http://forum.nim-lang.org/t/2457#15252](http://forum.nim-lang.org///forum.nim-lang.org/t/2457#15252)
 ?