{"action":"created","issue":{"url":"https://api.github.com/repos/tweag/inline-java/issues/71","repository_url":"https://api.github.com/repos/tweag/inline-java","labels_url":"https://api.github.com/repos/tweag/inline-java/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/tweag/inline-java/issues/71/comments","events_url":"https://api.github.com/repos/tweag/inline-java/issues/71/events","html_url":"https://github.com/tweag/inline-java/pull/71","id":237558910,"number":71,"title":"Implement push and pop family of functions for managing local references.","user":{"login":"mboes","id":51356,"avatar_url":"https://avatars2.githubusercontent.com/u/51356?v=3","gravatar_id":"","url":"https://api.github.com/users/mboes","html_url":"https://github.com/mboes","followers_url":"https://api.github.com/users/mboes/followers","following_url":"https://api.github.com/users/mboes/following{/other_user}","gists_url":"https://api.github.com/users/mboes/gists{/gist_id}","starred_url":"https://api.github.com/users/mboes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mboes/subscriptions","organizations_url":"https://api.github.com/users/mboes/orgs","repos_url":"https://api.github.com/users/mboes/repos","events_url":"https://api.github.com/users/mboes/events{/privacy}","received_events_url":"https://api.github.com/users/mboes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-21T14:42:48Z","updated_at":"2017-06-21T15:32:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tweag/inline-java/pulls/71","html_url":"https://github.com/tweag/inline-java/pull/71","diff_url":"https://github.com/tweag/inline-java/pull/71.diff","patch_url":"https://github.com/tweag/inline-java/pull/71.patch"},"body":"JNI Local references don't disappear until the control flow escapes\nthe current native call frame. This can be a very long time indeed, or\nin fact never in the case of standalone apps. So we introduce `push`\nto allocate a new block to store local references in. These references\ncan be discarded all at once when the control flow exits the scope of\nthe push. There is only one way to return a value out of the scope of\na push: by calling one of `popWithValue` or `popWithObject`. The\nlatter function is expected to be the common case. It's a thin wrapper\non top of `PopLocalFrame()` in the JNI, which only works for returning\nobjects.\n\nThere is nothing preventing the return of a local reference outside of\nthe scope in which it was allocated. But neither do any alternatives\nthat don't in one way or another link the type of references to the\ntype of the monad (like e.g. `STRef` in the `ST` monad). The design of\nthe API simply tries to make it unlikely.\n\n`push` and `pop` cannot be added to tests yet, due to\nhttps://github.com/hspec/hspec/pull/318 being a blocker. So we'll have\nto keep those out for now."},"comment":{"url":"https://api.github.com/repos/tweag/inline-java/issues/comments/310117041","html_url":"https://github.com/tweag/inline-java/pull/71#issuecomment-310117041","issue_url":"https://api.github.com/repos/tweag/inline-java/issues/71","id":310117041,"user":{"login":"mboes","id":51356,"avatar_url":"https://avatars2.githubusercontent.com/u/51356?v=3","gravatar_id":"","url":"https://api.github.com/users/mboes","html_url":"https://github.com/mboes","followers_url":"https://api.github.com/users/mboes/followers","following_url":"https://api.github.com/users/mboes/following{/other_user}","gists_url":"https://api.github.com/users/mboes/gists{/gist_id}","starred_url":"https://api.github.com/users/mboes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mboes/subscriptions","organizations_url":"https://api.github.com/users/mboes/orgs","repos_url":"https://api.github.com/users/mboes/repos","events_url":"https://api.github.com/users/mboes/events{/privacy}","received_events_url":"https://api.github.com/users/mboes/received_events","type":"User","site_admin":false},"created_at":"2017-06-21T15:32:28Z","updated_at":"2017-06-21T15:32:28Z","body":"There's no property of these functions that's easily testable, but what we can do is wrap all existing tests with `push` / `pop`. But those are in `SpecM`, not `IO`."}}
{"actor":{"display_login":"mboes"}}