Why the variable's value does not change?

Try

a = Ref(20000)
TestAdd(a)
println(a[]) 

Ref(a) has nothing to do with a, it creates a reference to the value of a not to the variable a.

2 Likes