{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/10403","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/10403/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/10403/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/10403/events","html_url":"https://github.com/JuliaLang/julia/issues/10403","id":59914566,"number":10403,"title":"A more diligent name resolution?","user":{"login":"ninegua","id":1549364,"avatar_url":"https://avatars.githubusercontent.com/u/1549364?v=3","gravatar_id":"","url":"https://api.github.com/users/ninegua","html_url":"https://github.com/ninegua","followers_url":"https://api.github.com/users/ninegua/followers","following_url":"https://api.github.com/users/ninegua/following{/other_user}","gists_url":"https://api.github.com/users/ninegua/gists{/gist_id}","starred_url":"https://api.github.com/users/ninegua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ninegua/subscriptions","organizations_url":"https://api.github.com/users/ninegua/orgs","repos_url":"https://api.github.com/users/ninegua/repos","events_url":"https://api.github.com/users/ninegua/events{/privacy}","received_events_url":"https://api.github.com/users/ninegua/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"milestone":null,"comments":38,"created_at":"2015-03-05T07:16:32Z","updated_at":"2015-07-10T20:59:12Z","closed_at":"2015-07-10T20:59:12Z","body":"Before I raise the problem, please help clarifying two of my understandings:\r\n\r\n1. Julia is strictly a lexically scoped language. That is, a variable or function name only resolves to a declaration in its enclosing (or parent or ancestor) lexical scope. \r\n\r\n2. Julia doesn't do any late binding. That is, once a name is resolved, it shall always point to the same object (or reference).\r\n\r\nIf both the above are true, then the following shall be their logical consequences:\r\n\r\n3. It is safe to always resolve a name \"statically\", i.e., at the compilation time of its enclosing function.\r\n\r\n4. If a name cannot be resolved \"statically\", then it is an error. \r\n\r\nI put \"statically\" in quotes because Julia is certainly dynamic, but on the other hand, in the current implementation, once a Julia function is compiled, it stays compiled, and a compiled function does not attempt to resolve names at runtime.\r\n\r\nWith the above understanding, may I request the following feature to be implemented?\r\n\r\n5. All names (of Symbol type) shall be resolved during (or before) type inference, and it is an error to have unresolved names remaining in typed AST.\r\n\r\nThis will save a lot of trouble of implementing optimizations leveraging type information available in typed AST, because typed AST will no longer contain unresolved names, and all resolved names will only be of 3 forms: TopNode (for system definitions), GetfieldNode (for module-level definitions), SymbolNode (for local definitions). In all cases, it would be straightforward to obtain the type of a name.\r\n\r\n"}}