-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
scoping issues, part 1 #423
Copy link
Copy link
Closed
Labels
breakingThis change will break codeThis change will break codeneeds decisionA decision on this change is neededA decision on this change is neededspeculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative
Milestone
Metadata
Metadata
Assignees
Labels
breakingThis change will break codeThis change will break codeneeds decisionA decision on this change is neededA decision on this change is neededspeculativeWhether the change will be implemented is speculativeWhether the change will be implemented is speculative
Hello Julia developers,
congratulations with your great new language. I was singing 'O Julia' out loud all day yesterday.
But now my bug report. Notwithstanding the
let,globalandlocalkeywords, it seems there is not always a clear distinction in Julia between variable declaration and assignment. This breaks encapsulation and can lead to hard to find bugs.Matlab's scoping rules we don't even need to discuss [1], Coffeescript is a disaster [2], please don't copy Ruby on this one [3], Perl and Javascript are ok as long as you don't forget your
my's andvar's (or use strict), Python fixed it in version 3 [4], and one could say Scheme got it right the first time in 1970 [5].What is the reasoning behind Julia's intricate scoping rules?
[1] http://www.mathworks.nl/help/techdoc/matlab_prog/f4-39683.html#f4-73993
[2] jashkenas/coffeescript#712
[3] http://www.rubyist.net/~matz/slides/rc2003/mgp00010.html
[4] http://www.python.org/dev/peps/pep-3104/
[5] http://news.ycombinator.com/item?id=3379962