Thanks for your help. I read the URL before posting this question, but I used to think that the `x’ in the let and begin blocks were locally scoped.
And @dlakelan pointed out that `x’ in the begin block is globally scoped, now I can understand the difference result in my code.