pass by reference but reference to data and not to variable
- by dorelal
This is psesudo code. In what programming language this is possible ?
def lab(input)
input = ['90']
end
x = ['80']
lab(x)
puts x #=> value of x has changed from ['80'] to ['90]
I have written this in ruby but in ruby I get the final x value of 80
because ruby is pass-by-reference. However what is passed is the
reference to the data held by x and not pointer to x itself
same is true in JavaScript. So I am wondering if there is any
programming language where the following is true.