{"action":"created","issue":{"url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng/issues/48","repository_url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng","labels_url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng/issues/48/comments","events_url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng/issues/48/events","html_url":"https://github.com/kovidgoyal/rapydscript-ng/issues/48","id":197784183,"number":48,"title":"global and nonlocal","user":{"login":"BruceSherwood","id":1127471,"avatar_url":"https://avatars.githubusercontent.com/u/1127471?v=3","gravatar_id":"","url":"https://api.github.com/users/BruceSherwood","html_url":"https://github.com/BruceSherwood","followers_url":"https://api.github.com/users/BruceSherwood/followers","following_url":"https://api.github.com/users/BruceSherwood/following{/other_user}","gists_url":"https://api.github.com/users/BruceSherwood/gists{/gist_id}","starred_url":"https://api.github.com/users/BruceSherwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BruceSherwood/subscriptions","organizations_url":"https://api.github.com/users/BruceSherwood/orgs","repos_url":"https://api.github.com/users/BruceSherwood/repos","events_url":"https://api.github.com/users/BruceSherwood/events{/privacy}","received_events_url":"https://api.github.com/users/BruceSherwood/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-12-28T02:09:36Z","updated_at":"2016-12-30T02:52:36Z","closed_at":"2016-12-28T03:44:21Z","body":"The documentation advocates the use of nonlocal rather than global, with reference to Python 3, with the comment \"There is also global\". However, it looks like a bug that RS 1) has not implemented \"global\" and 2) has not restricted \"nonlocal\" to use in nested methods, as seems to be the case in Python 3. At the time of implementing the use of RS in GlowScript, I was unfamiliar with \"nonlocal\" and in a preprocessing stage simply converted a user program \"global\" to \"nonlocal\", which did what was expected, except that in true Python one need not separately declare the variable in global scope, whereas in RS one must do so. Am I confused, or is this a bug?"},"comment":{"url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng/issues/comments/269725557","html_url":"https://github.com/kovidgoyal/rapydscript-ng/issues/48#issuecomment-269725557","issue_url":"https://api.github.com/repos/kovidgoyal/rapydscript-ng/issues/48","id":269725557,"user":{"login":"kovidgoyal","id":1308621,"avatar_url":"https://avatars.githubusercontent.com/u/1308621?v=3","gravatar_id":"","url":"https://api.github.com/users/kovidgoyal","html_url":"https://github.com/kovidgoyal","followers_url":"https://api.github.com/users/kovidgoyal/followers","following_url":"https://api.github.com/users/kovidgoyal/following{/other_user}","gists_url":"https://api.github.com/users/kovidgoyal/gists{/gist_id}","starred_url":"https://api.github.com/users/kovidgoyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kovidgoyal/subscriptions","organizations_url":"https://api.github.com/users/kovidgoyal/orgs","repos_url":"https://api.github.com/users/kovidgoyal/repos","events_url":"https://api.github.com/users/kovidgoyal/events{/privacy}","received_events_url":"https://api.github.com/users/kovidgoyal/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T02:52:36Z","updated_at":"2016-12-30T02:52:36Z","body":"I just realized there was an easy way to implement partial global support (basically it works just like nonlocal except it also declares the variables at the top level of the module -- see the changes to README for the caveat).\r\n\r\nThe embedded compiler is auto-updated every time a new rs-ng release is made. You can always generate your own from a source checkout, instructions are in the README. "}}
{"actor":{"display_login":"kovidgoyal"}}