Hello, I would like to write a function that is meant to run inside another function (or standalone), that modifies one of the variables of the namespace. An example would be:
k = 1 function dob(k) for i in 1:5 k *= 2 end return true end dob(k) # = 1, I would like it to be 32
I understand the behavior and why it doesn’t work. I wanted to ask what is the right way to do it. I could save the value in an object that gets passed as an argument to the function or I could request the global variable.