In Julia-0.3.0-prerelease-d2d9bd93ed.app on Mac OS X 10.6:
The following test case was boiled down from a much larger piece of code.
function f(x)
answer = false
if (x > 10)
anwser = true
end
return answer
end
does not issue any warnings, and always returns false. Shouldn't it warn
that anwser is defined as a local variable but never read?
Is there a way to do an assignment to an existing local variable without
the possibility of declaring a new one, to avoid the possibility of bugs
like this as well as clarify the intention of the code? Is := already
used? In testing := behaves strangely, not similar to :+ which is quote of
+, so I am not sure what := means now. If I could have written
function f(x)
answer = false
if (x > 10)
anwser := true
end
return answer
end
and had it say "anwser is not a known variable" my problem would have been
obvious.