2 ms·
> 0.x scope rules... In short, for non-toy programs, it's a significant source of hard-to-find bugs. It seems like a lot of languages have lexical scoping whi
by UncleOxidant 6y ago
> 0.x scope rules... In short, for non-toy programs, it's a significant source of hard-to-find bugs.
It seems like a lot of languages have lexical scoping which IIRC was what 0.x had. (Scheme, Lisp, OCaml are a few examples) Are there aspects of Julia that make lexical scoping particularly problematic? Julia 1.x scoping rules look similar to Tcl's.
- StefanKarpinski 6y agoJulia has utterly standard lexical scoping—and always has. This issue has nothing to do with lexical vs dynamic scoping, it has to do with whether an assignment in a loop clobbers a global (convenient but dangerous) or creates a loop-local variable (safe but sometimes inconvenient). Have you read the linked manual section on scope? It is very clear and explains the design considerations quite thoroughly.