{"action":"created","issue":{"url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/issues/85","repository_url":"https://api.github.com/repos/MikeInnes/MacroTools.jl","labels_url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/issues/85/comments","events_url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/issues/85/events","html_url":"https://github.com/MikeInnes/MacroTools.jl/pull/85","id":347929257,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NDAzMDg1","number":85,"title":"Move initializing `animals` out of __init__ to global scope.","user":{"login":"NHDaly","id":1582097,"node_id":"MDQ6VXNlcjE1ODIwOTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1582097?v=4","gravatar_id":"","url":"https://api.github.com/users/NHDaly","html_url":"https://github.com/NHDaly","followers_url":"https://api.github.com/users/NHDaly/followers","following_url":"https://api.github.com/users/NHDaly/following{/other_user}","gists_url":"https://api.github.com/users/NHDaly/gists{/gist_id}","starred_url":"https://api.github.com/users/NHDaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NHDaly/subscriptions","organizations_url":"https://api.github.com/users/NHDaly/orgs","repos_url":"https://api.github.com/users/NHDaly/repos","events_url":"https://api.github.com/users/NHDaly/events{/privacy}","received_events_url":"https://api.github.com/users/NHDaly/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-06T13:42:28Z","updated_at":"2018-08-21T14:04:00Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/pulls/85","html_url":"https://github.com/MikeInnes/MacroTools.jl/pull/85","diff_url":"https://github.com/MikeInnes/MacroTools.jl/pull/85.diff","patch_url":"https://github.com/MikeInnes/MacroTools.jl/pull/85.patch"},"body":"Before, having `__init__` read from the filesystem was causing problems with\r\nstatic compiling.\r\n\r\nSo I've just moved the initialization out of the `__init__` function, and deleted the now-empty function entirely.\r\n\r\nPer the julia docs, intializing an array like this doesn't need to be in\r\n`__init__` anway, the whole array can be serialized during precompilation.\r\n\r\nHere's the relevant section (from [Module-initialization-and-precompilation](https://docs.julialang.org/en/v0.6.4/manual/modules/#Module-initialization-and-precompilation-1)):\r\n\r\n> Constants involving most Julia objects that are not produced by ccall\r\n> do not need to be placed in __init__: their definitions can be\r\n> precompiled and loaded from the cached module image. This includes\r\n> complicated heap-allocated objects like arrays. However, any routine\r\n> that returns a raw pointer value must be called at runtime for\r\n> precompilation to work (Ptr objects will turn into null pointers\r\n> unless they are hidden inside an isbits object). This includes the\r\n> return values of the Julia functions cfunction and pointer."},"comment":{"url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/issues/comments/414685639","html_url":"https://github.com/MikeInnes/MacroTools.jl/pull/85#issuecomment-414685639","issue_url":"https://api.github.com/repos/MikeInnes/MacroTools.jl/issues/85","id":414685639,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDY4NTYzOQ==","user":{"login":"NHDaly","id":1582097,"node_id":"MDQ6VXNlcjE1ODIwOTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1582097?v=4","gravatar_id":"","url":"https://api.github.com/users/NHDaly","html_url":"https://github.com/NHDaly","followers_url":"https://api.github.com/users/NHDaly/followers","following_url":"https://api.github.com/users/NHDaly/following{/other_user}","gists_url":"https://api.github.com/users/NHDaly/gists{/gist_id}","starred_url":"https://api.github.com/users/NHDaly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NHDaly/subscriptions","organizations_url":"https://api.github.com/users/NHDaly/orgs","repos_url":"https://api.github.com/users/NHDaly/repos","events_url":"https://api.github.com/users/NHDaly/events{/privacy}","received_events_url":"https://api.github.com/users/NHDaly/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T14:04:00Z","updated_at":"2018-08-21T14:04:00Z","author_association":"NONE","body":"I should add that this is a follow-up to https://github.com/MikeInnes/MacroTools.jl/pull/77 which helped, but didn't solve the problem."}}
{"actor":{"display_login":"NHDaly"}}