Say I want to write a function that makes all bools false:
function true_to_false!(boolean::Bool)
boolean = false
end
Why can I then not use this to change the values of another function? e.g.:
function make_x_false()
x = true
true_to_false!(x)
return x
end
Returns true
.
Of course there are workarounds such as
function make_x_false()
x = true
x = true_to_false!(x)
end
and
function make_x_false!(x)
x = true_to_false!(x)
end
But I have a case where these would make for some very messy code!
Thanks,