{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/30399","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/30399/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/30399/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/30399/events","html_url":"https://github.com/JuliaLang/julia/pull/30399","id":391405444,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4OTI4MzE4","number":30399,"title":"Improve documentation related to JL_GC_PUSH*","user":{"login":"ronisbr","id":1068295,"node_id":"MDQ6VXNlcjEwNjgyOTU=","avatar_url":"https://avatars1.githubusercontent.com/u/1068295?v=4","gravatar_id":"","url":"https://api.github.com/users/ronisbr","html_url":"https://github.com/ronisbr","followers_url":"https://api.github.com/users/ronisbr/followers","following_url":"https://api.github.com/users/ronisbr/following{/other_user}","gists_url":"https://api.github.com/users/ronisbr/gists{/gist_id}","starred_url":"https://api.github.com/users/ronisbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronisbr/subscriptions","organizations_url":"https://api.github.com/users/ronisbr/orgs","repos_url":"https://api.github.com/users/ronisbr/repos","events_url":"https://api.github.com/users/ronisbr/events{/privacy}","received_events_url":"https://api.github.com/users/ronisbr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-12-15T19:32:22Z","updated_at":"2018-12-17T17:06:04Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/30399","html_url":"https://github.com/JuliaLang/julia/pull/30399","diff_url":"https://github.com/JuliaLang/julia/pull/30399.diff","patch_url":"https://github.com/JuliaLang/julia/pull/30399.patch"},"body":"Hi guys,\r\n\r\nI had some problems related to embedding Julia in C/C++ software. I posted some topics in Discourse and, finally, I managed to make it work. This PR tries to improve the documentation based on my experience and some advices I found on old Discourse posts. Please, help me to review this, because I am not entirely sure that everything is correct."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/447920972","html_url":"https://github.com/JuliaLang/julia/pull/30399#issuecomment-447920972","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/30399","id":447920972,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzkyMDk3Mg==","user":{"login":"yuyichao","id":712232,"node_id":"MDQ6VXNlcjcxMjIzMg==","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-12-17T17:06:04Z","updated_at":"2018-12-17T17:06:04Z","author_association":"MEMBER","body":"> This was just a little example to see the easiest way to create a `RefValue`\r\n\r\nWell, that's fine, as long as you don't\r\n\r\n>> put the example when you have to wrap around a `RefValue` to make things clear to the user.\r\n\r\nPutting this example here will definitely not make it more clear to the user.\r\n\r\n> `jl_value_t* rvar = jl_new_struct(reft, &var);`\r\n\r\n`jl_new_struct(reft, var)`\r\n\r\n> ```julia\r\n>     jl_function_t* setindex = jl_get_function(jl_base_module, \"setindex!\");\r\n>     jl_value_t* refs = jl_eval_string(\"refs = IdDict()\");\r\n>     jl_call3(setindex, refs, rvar, rvar);\r\n> ```\r\n\r\nAnd given that you've asked about `jl_set_global(jl_main_module, jl_symbol(\"var\"), var);`, I would definitely make it clcear that, `setindex`, `refs` (and also `reft`) should only be created during initialization and not on each invocation of the function.\r\n"}}
{"actor":{"display_login":"yuyichao"}}