{"action":"created","issue":{"url":"https://api.github.com/repos/parapluu/encore/issues/805","repository_url":"https://api.github.com/repos/parapluu/encore","labels_url":"https://api.github.com/repos/parapluu/encore/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/parapluu/encore/issues/805/comments","events_url":"https://api.github.com/repos/parapluu/encore/issues/805/events","html_url":"https://github.com/parapluu/encore/pull/805","id":228223668,"number":805,"title":"Extended forward() for using in closure","user":{"login":"PhucVH888","id":11764206,"avatar_url":"https://avatars0.githubusercontent.com/u/11764206?v=3","gravatar_id":"","url":"https://api.github.com/users/PhucVH888","html_url":"https://github.com/PhucVH888","followers_url":"https://api.github.com/users/PhucVH888/followers","following_url":"https://api.github.com/users/PhucVH888/following{/other_user}","gists_url":"https://api.github.com/users/PhucVH888/gists{/gist_id}","starred_url":"https://api.github.com/users/PhucVH888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhucVH888/subscriptions","organizations_url":"https://api.github.com/users/PhucVH888/orgs","repos_url":"https://api.github.com/users/PhucVH888/repos","events_url":"https://api.github.com/users/PhucVH888/events{/privacy}","received_events_url":"https://api.github.com/users/PhucVH888/received_events","type":"User","site_admin":false},"labels":[{"id":262091362,"url":"https://api.github.com/repos/parapluu/encore/labels/ready%20for%20review","name":"ready for review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-05-12T08:35:00Z","updated_at":"2017-07-12T11:03:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/parapluu/encore/pulls/805","html_url":"https://github.com/parapluu/encore/pull/805","diff_url":"https://github.com/parapluu/encore/pull/805.diff","patch_url":"https://github.com/parapluu/encore/pull/805.patch"},"body":"### Introduction\r\nTo recall, the `forward` is designed to delegate the future and to be fulfilled by other delegated method. In summary, `forward` can be used in the following four cases.\r\n\r\n1. DONE: forward MethodCall (#682)\r\n2. DONE: forward FutureChaining (#784)\r\n3. DONE: forward PreexistingFuture (#784)\r\n4. forward in closure's body\r\n\r\nIn this PR, the `forward()` can be used in closure.\r\n\r\n### Syntax\r\n```\r\n4. forward(arg ~~> fun () => forward(tmp)\r\n```\r\n### Semantics\r\n#### 4. `forward in closure's body`\r\n```\r\n      forward(f ~~> fun(x:int) => forward(g))\r\n```\r\nwhere `f` and `g` are preexisting futures.\r\n```\r\nclass Base\r\n  def one(g : Fut[int]) : int\r\n    forward( (new Foo) ! foo() ~~> fun(x : int) => forward(g))\r\n  end\r\nend\r\n```\r\n### Examples\r\nYou can find many examples in the src/tests/encore/forward folder.\r\n"},"comment":{"url":"https://api.github.com/repos/parapluu/encore/issues/comments/314735576","html_url":"https://github.com/parapluu/encore/pull/805#issuecomment-314735576","issue_url":"https://api.github.com/repos/parapluu/encore/issues/805","id":314735576,"user":{"login":"PhucVH888","id":11764206,"avatar_url":"https://avatars0.githubusercontent.com/u/11764206?v=3","gravatar_id":"","url":"https://api.github.com/users/PhucVH888","html_url":"https://github.com/PhucVH888","followers_url":"https://api.github.com/users/PhucVH888/followers","following_url":"https://api.github.com/users/PhucVH888/following{/other_user}","gists_url":"https://api.github.com/users/PhucVH888/gists{/gist_id}","starred_url":"https://api.github.com/users/PhucVH888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhucVH888/subscriptions","organizations_url":"https://api.github.com/users/PhucVH888/orgs","repos_url":"https://api.github.com/users/PhucVH888/repos","events_url":"https://api.github.com/users/PhucVH888/events{/privacy}","received_events_url":"https://api.github.com/users/PhucVH888/received_events","type":"User","site_admin":false},"created_at":"2017-07-12T11:03:21Z","updated_at":"2017-07-12T11:03:21Z","body":"@supercooldave : The `forward` is not allowed to be used in function, it has been checked in the test case `forwardFunction.enc`. However, the case that `forward` is nested in the `closure` is not rejected. I will fixed it."}}
{"actor":{"display_login":"PhucVH888"}}