Yes, I think the last example is the most annoying one as, to solve it, we have 
to do a copy which is just something we don't want to do for obvious 
performance reasons. I have tried to change the parameter type from sequence to 
openarray with same result. And with an array instead of a sequence, we get the 
same behavior too. So, changing the semantic for sequences would not be enough, 
we would have to change the semantic for arrays, too, and kill the whole copy 
semantic of the language. Not the right way to go, I think.

Maybe a clear distinction between mutable and immutable will indeed solve the 
issue. The difficulty is to find a balance between the increased complexity of 
the language and the performance.

Reply via email to