You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The return value of a function is determined by the function as defined in the last appearance in the code, instead of the value of the function as it is defined at the moment of the evaluation. Take, for instance
function f()
g() = 1
return g()
g() = 2
end
When calling f() it returns 2, even if the definition of g as the constant function 2 was never reached. I would expect this code to return 1.
versioninfo()
Julia Version 1.0.1
Commit 0d71392 (2018-09-29 19:05 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
The text was updated successfully, but these errors were encountered:
The return value of a function is determined by the function as defined in the last appearance in the code, instead of the value of the function as it is defined at the moment of the evaluation. Take, for instance
When calling
f()
it returns2
, even if the definition ofg
as the constant function 2 was never reached. I would expect this code to return1
.versioninfo()
Julia Version 1.0.1
Commit 0d71392 (2018-09-29 19:05 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
The text was updated successfully, but these errors were encountered: