I haven't played with nim for a few months, but only parameters with var will get mutated. I suspect you want to use someone else's cursed function and don't want to poison your blessed code
var arr1 = [4, 2, 3, 6]
sort arr1
# Doesn't work
let arr2 = [4, 2, 3, 6]
sort arr2
You'll get a warning about the latter from the compiler (and nimsuggest for editors).