Hi, I have same code in both let
block and begin
block, but get totally different results,
any suggestion for understand this?
begin
x = randn(100,10)
function f()
x = randn(2,2)
return 1
end
a = f()
println(size(x))
end
# (100,10)
let
x = randn(100,10)
function f()
x = randn(2,2)
return 1
end
a = f()
println(size(x))
end
#(2,2)
why the f()
in let
block could change the value of x?, they are different scope, I think.
Thanks for your help.