I have two functions which I am unable to tell if they are pure or not.
Here is the first one.
someFunction(ref input1, ref input2) {
input2 = input1 + input2
return input2
}
I believe that its an impure function because it is allowing mutability of input2. But why is this a problem? We cannot access input2 outside of the function, so I don't see why it matters if it is mutated or not.
Here is my second function.
someFunction(ref input1, ref input2) {
return input1 + input2
}
Again, I think this is an impure function because it's passing input1 and input2 by reference. But again, I don't see why this is a problem. We are not modifying input1 or input2... so why would this function be impure?