When you ask why, do you want to know scoing rules defined in the language, or the rationale for making language design choices? Here’s the rules, if that’s what you want:
https://docs.julialang.org/en/v1/manual/variables-and-scoping/
3 Likes