{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/6884","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/6884/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/6884/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/6884/events","html_url":"https://github.com/JuliaLang/julia/pull/6884","id":33772257,"number":6884,"title":"RFC: adds conditional modules (#6195)","user":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars.githubusercontent.com/u/330950?v=3","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/JuliaLang/julia/milestones/8","html_url":"https://github.com/JuliaLang/julia/milestones/0.4.x","labels_url":"https://api.github.com/repos/JuliaLang/julia/milestones/8/labels","id":303801,"number":8,"title":"0.4.x","description":"Bugs that should be fixed within the 0.4.x series. Can be fixed for 0.4 as well, but do not block the 0.4 release.","creator":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars.githubusercontent.com/u/330950?v=3","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"open_issues":77,"closed_issues":92,"state":"open","created_at":"2013-04-05T16:15:28Z","updated_at":"2015-07-15T05:02:01Z","due_on":null,"closed_at":null},"comments":60,"created_at":"2014-05-19T05:43:36Z","updated_at":"2015-07-16T17:04:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/6884","html_url":"https://github.com/JuliaLang/julia/pull/6884","diff_url":"https://github.com/JuliaLang/julia/pull/6884.diff","patch_url":"https://github.com/JuliaLang/julia/pull/6884.patch"},"body":"conditional modules (described in julep #6195) are executed when a dependency module becomes\r\navailable and/or replaced. it has the following syntax:\r\n\r\n```\r\nmodule A requires B, C.D\r\n  using B\r\n  import C.D\r\n  # do stuff with B, C.D\r\n  # module A will be rerun whenever\r\n  # B or C.D are (re)defined\r\nend\r\n```\r\n\r\nTODO:\r\n - [ ] sort & order (re)loading to minimize repeated work and standardize execution order\r\n - [ ] handle recursive requires more gracefully\r\n - [ ] add to documentation\r\n - [ ] add to tests\r\n - [ ] add better error message for accessing `A.B.*` when the dependencies for B are not loaded / add a placeholder module for `A.B` to reserve the name\r\n - [ ] decide whether `using A.B` should autoload the declared dependencies for B\r\n\r\nPossible changes:\r\n - [ ] decide whether to allow a literal tuple (spliced in from a macro) for the requirements list, or only \r\ntuple expressions\r\n - [ ] decide on `module ... requires ...` or `module ... when ...`\r\n - [ ] decide whether `...` should be automatically imported inside the module, to avoid repetition"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/122023366","html_url":"https://github.com/JuliaLang/julia/pull/6884#issuecomment-122023366","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/6884","id":122023366,"user":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars.githubusercontent.com/u/330950?v=3","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T17:04:56Z","updated_at":"2015-07-16T17:04:56Z","body":"```module Baz\r\nexport Foo.foo\r\n\r\nmodule Foo when Bar    \r\n    foo() = 1\r\nend\r\n\r\nend\r\n```"}}