See JuliaLang/julia#15602. You need to use anonymous functions:
function test(flag=true)
if flag
myfunc = () -> 1
else
myfunc = () -> 0
end
println(myfunc())
return
end
See JuliaLang/julia#15602. You need to use anonymous functions:
function test(flag=true)
if flag
myfunc = () -> 1
else
myfunc = () -> 0
end
println(myfunc())
return
end