{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/Compat.jl/issues/491","repository_url":"https://api.github.com/repos/JuliaLang/Compat.jl","labels_url":"https://api.github.com/repos/JuliaLang/Compat.jl/issues/491/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/Compat.jl/issues/491/comments","events_url":"https://api.github.com/repos/JuliaLang/Compat.jl/issues/491/events","html_url":"https://github.com/JuliaLang/Compat.jl/pull/491","id":297285833,"number":491,"title":"Add GC.at-preserve","user":{"login":"ararslan","id":6396159,"avatar_url":"https://avatars1.githubusercontent.com/u/6396159?v=4","gravatar_id":"","url":"https://api.github.com/users/ararslan","html_url":"https://github.com/ararslan","followers_url":"https://api.github.com/users/ararslan/followers","following_url":"https://api.github.com/users/ararslan/following{/other_user}","gists_url":"https://api.github.com/users/ararslan/gists{/gist_id}","starred_url":"https://api.github.com/users/ararslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ararslan/subscriptions","organizations_url":"https://api.github.com/users/ararslan/orgs","repos_url":"https://api.github.com/users/ararslan/repos","events_url":"https://api.github.com/users/ararslan/events{/privacy}","received_events_url":"https://api.github.com/users/ararslan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":32,"created_at":"2018-02-14T23:45:11Z","updated_at":"2018-03-27T17:24:22Z","closed_at":"2018-03-18T21:09:37Z","author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/JuliaLang/Compat.jl/pulls/491","html_url":"https://github.com/JuliaLang/Compat.jl/pull/491","diff_url":"https://github.com/JuliaLang/Compat.jl/pull/491.diff","patch_url":"https://github.com/JuliaLang/Compat.jl/pull/491.patch"},"body":"Ref discussion in https://github.com/JuliaLang/julia/pull/25616"},"comment":{"url":"https://api.github.com/repos/JuliaLang/Compat.jl/issues/comments/376607015","html_url":"https://github.com/JuliaLang/Compat.jl/pull/491#issuecomment-376607015","issue_url":"https://api.github.com/repos/JuliaLang/Compat.jl/issues/491","id":376607015,"user":{"login":"yuyichao","id":712232,"avatar_url":"https://avatars3.githubusercontent.com/u/712232?v=4","gravatar_id":"","url":"https://api.github.com/users/yuyichao","html_url":"https://github.com/yuyichao","followers_url":"https://api.github.com/users/yuyichao/followers","following_url":"https://api.github.com/users/yuyichao/following{/other_user}","gists_url":"https://api.github.com/users/yuyichao/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyichao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyichao/subscriptions","organizations_url":"https://api.github.com/users/yuyichao/orgs","repos_url":"https://api.github.com/users/yuyichao/repos","events_url":"https://api.github.com/users/yuyichao/events{/privacy}","received_events_url":"https://api.github.com/users/yuyichao/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T17:24:22Z","updated_at":"2018-03-27T17:24:22Z","author_association":"MEMBER","body":"The basic requirement that everything in Compat should have is that the definition with the right name should do the right thing. We do accept exception but in those cases the Compat definition should throw an error. In another word, the definition must do the same thing or error.\r\n\r\nNote that this is very different from what a package may actually want. For this particular example, I do believe most of the package will not hit most of the corner cases, but I do believe all of the corner cases mentioned in this thread will be hit by some packages. That's what make it sometimes a better solution for the package to just define it's own version that satisfy only it's need if it won't be affected by any special cases.\r\n\r\nThe different in scope is actually a major difference but I said it's a borderline case since that case is actually detectable in certain cense. If the `Compat.@gc_preserve` for 0.6 is written so that it only accept `while`, `for`, `let` or `try` blocks as the last argument this will fully satisfy the requirement of doing the right thing or error.\r\n\r\n> because it wouldn't be worse than what people usually do right now.\r\n\r\nThis is the argument I don't buy because there is actually well defined way to do this correctly on 0.6, just that those solutions can't be made into a `@gc_preserve` macro. Most of the cases that do simple C-interop should just use `cconvert` and `unsafe_convert`, on both 0.6 and 0.7 as mentioned above. I'm pretty sure I've also mentioned this in another thread on this topic that the most reliable way to do this on 0.6 is to use a noninline function since the compiler will always make sure the argument is rooted inside the function, at least on 0.6.\r\n"}}
{"actor":{"display_login":"yuyichao"}}