{"action":"created","comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/62202307","id":62202307,"diff_hunk":"@@ -0,0 +1,183 @@\n+Alternative Initializer Features\n+================================\n+\n+Status:\n+  Rejected\n+\n+Authors:\n+  Kyle Brady, Lydia Duncan, Michael Ferguson, Mike Noakes, Vassily Litvinov (for Syntax 2);\n+  Vassily Litvinov (for Child Fields and Initialization Completion)\n+\n+Abstract\n+--------\n+\n+This document contains the features we discussed as part of the\n+initializer story and chose not to incorporate.\n+\n+Rationale\n+---------\n+\n+During our development of the initializer story for Chapel\n+we considered a variety of features. Some of them were accepted\n+and some of them were rejected. This document records some of\n+the discussed-and-rejected features for posterity.\n+\n+Description\n+-----------\n+\n+Alternative syntax for distinguishing Phase 1 and Phase 2 in an initializer\n+***************************************************************************\n+\n+We considered providing dedicated syntax for distinguishing Phase 1\n+and Phase 2 in an initializer. This syntax, codenamed Syntax 2,\n+designates different block statements for Phase 1 and Phase 2,\n+separated by the proposed \"finalize\" keyword.\n+\n+.. code-block:: chapel\n+\n+   proc init() {\n+     ... Phase 1 code ...\n+     super.init(...);\n+   } finalize {\n+     ... Phase 2 code ...\n+   }\n+\n+Certain pieces of this syntax could be omitted as follows:\n+\n+* The super.init() call, if it takes no arguments.\n+\n+* The Phase 1 block statement, if contains no statements.\n+  In this case, the \"finalize\" keyword can also be omitted.\n+  Default field initializations followed by super.init() call\n+  with no arguments occur in this case.\n+\n+Here is an example of an initializer where only Phase 2 is\n+specified explicitly:\n+\n+.. code-block:: chapel\n+\n+   proc init() {\n+     ... Phase 2 code ...\n+   }\n+\n+Syntax 2 has the advantage of visually-clear separation of the two\n+phases. We did not incorporate it because it did not allow sharing\n+variables or extending an if statement across the two phases.\n+\n+Child's fields could depend on parent's fields\n+**********************************************\n+\n+We considered allowing child's fields to be initialized based on\n+parent's fields. Below is one way to achieve this.\n+\n+The child's initializer could control where, in its Phase 1, the\n+parent's Phase 1 is invoked. In other words, the parent's Phase 1\n+would not necessarily come at the end of the child initializer's Phase 1.\n+The following example shows that based on Syntax 2.\n+\n+.. code-block:: chapel\n+\n+   class Parent {\n+     var D: domain(1);\n+     proc init(myRange) {\n+       D = {myRange};  // Phase 1\n+     } finalize {\n+       ... Phase 2 code ...\n+     }\n+   }\n+\n+   class Child: Parent {\n+     var xD: domain(1);\n+     proc init(myRange, extra) {\n+       super.init(myRange);   // initializes Parent.D\n+       xD = D.expand(extra);  // initialize xD based on Parent.D\n+     } finalize {\n+       ... Phase 2 code ...\n+     }\n+   }\n+\n+Analogously, we could allow the child initializer to control the point\n+during its Phase 2 when the parent initializer's Phase 2 is to be invoked.\n+For example:\n+\n+.. code-block:: chapel\n+\n+   class Child: Parent {\n+     proc init(...) {\n+       ... Phase 1 code ...\n+     } finalize {\n+       ... Phase 2 in Child ...\n+       super.finalize();      // executes Phase 2 in Parent\n+     }\n+   }\n+\n+We did not incorporate this functionality because it adds complexity to\n+how initialization occurs.\n+\n+\n+Parent could complete initialization after child's initialization is complete","path":"doc/chips/11.rst","position":118,"original_position":118,"commit_id":"df4955ec9481992ecb62a0feded83702c70eb7f4","original_commit_id":"df4955ec9481992ecb62a0feded83702c70eb7f4","user":{"login":"lydia-duncan","id":2454710,"avatar_url":"https://avatars.githubusercontent.com/u/2454710?v=3","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false},"body":"And since the previous option could also fall under \"Parent could complete initialization after the child's initialization is complete\", the header should be renamed in either case.","created_at":"2016-05-05T15:19:50Z","updated_at":"2016-05-05T15:19:50Z","html_url":"https://github.com/chapel-lang/chapel/pull/3827#discussion_r62202307","pull_request_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827","_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/62202307"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/3827#discussion_r62202307"},"pull_request":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827"}}},"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827","id":68944497,"html_url":"https://github.com/chapel-lang/chapel/pull/3827","diff_url":"https://github.com/chapel-lang/chapel/pull/3827.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/3827.patch","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3827","number":3827,"state":"open","locked":false,"title":"Added CIHP 11 on discussed-and-rejected initializer features","user":{"login":"vasslitvinov","id":8039635,"avatar_url":"https://avatars.githubusercontent.com/u/8039635?v=3","gravatar_id":"","url":"https://api.github.com/users/vasslitvinov","html_url":"https://github.com/vasslitvinov","followers_url":"https://api.github.com/users/vasslitvinov/followers","following_url":"https://api.github.com/users/vasslitvinov/following{/other_user}","gists_url":"https://api.github.com/users/vasslitvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/vasslitvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasslitvinov/subscriptions","organizations_url":"https://api.github.com/users/vasslitvinov/orgs","repos_url":"https://api.github.com/users/vasslitvinov/repos","events_url":"https://api.github.com/users/vasslitvinov/events{/privacy}","received_events_url":"https://api.github.com/users/vasslitvinov/received_events","type":"User","site_admin":false},"body":"In today's initializer meeting we preferred placing such features in a separate chip instead of extending the existing chip. Therefore I am closing  #3823.\r\n","created_at":"2016-05-04T22:49:50Z","updated_at":"2016-05-05T15:19:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0eef8572d44dc1f8490b3d8bb5fbb7721ff92714","assignee":{"login":"lydia-duncan","id":2454710,"avatar_url":"https://avatars.githubusercontent.com/u/2454710?v=3","gravatar_id":"","url":"https://api.github.com/users/lydia-duncan","html_url":"https://github.com/lydia-duncan","followers_url":"https://api.github.com/users/lydia-duncan/followers","following_url":"https://api.github.com/users/lydia-duncan/following{/other_user}","gists_url":"https://api.github.com/users/lydia-duncan/gists{/gist_id}","starred_url":"https://api.github.com/users/lydia-duncan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lydia-duncan/subscriptions","organizations_url":"https://api.github.com/users/lydia-duncan/orgs","repos_url":"https://api.github.com/users/lydia-duncan/repos","events_url":"https://api.github.com/users/lydia-duncan/events{/privacy}","received_events_url":"https://api.github.com/users/lydia-duncan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/3827/comments","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/df4955ec9481992ecb62a0feded83702c70eb7f4","head":{"label":"vasslitvinov:CHIP-11-alt-init","ref":"CHIP-11-alt-init","sha":"df4955ec9481992ecb62a0feded83702c70eb7f4","user":{"login":"vasslitvinov","id":8039635,"avatar_url":"https://avatars.githubusercontent.com/u/8039635?v=3","gravatar_id":"","url":"https://api.github.com/users/vasslitvinov","html_url":"https://github.com/vasslitvinov","followers_url":"https://api.github.com/users/vasslitvinov/followers","following_url":"https://api.github.com/users/vasslitvinov/following{/other_user}","gists_url":"https://api.github.com/users/vasslitvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/vasslitvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasslitvinov/subscriptions","organizations_url":"https://api.github.com/users/vasslitvinov/orgs","repos_url":"https://api.github.com/users/vasslitvinov/repos","events_url":"https://api.github.com/users/vasslitvinov/events{/privacy}","received_events_url":"https://api.github.com/users/vasslitvinov/received_events","type":"User","site_admin":false},"repo":{"id":21914674,"name":"chapel","full_name":"vasslitvinov/chapel","owner":{"login":"vasslitvinov","id":8039635,"avatar_url":"https://avatars.githubusercontent.com/u/8039635?v=3","gravatar_id":"","url":"https://api.github.com/users/vasslitvinov","html_url":"https://github.com/vasslitvinov","followers_url":"https://api.github.com/users/vasslitvinov/followers","following_url":"https://api.github.com/users/vasslitvinov/following{/other_user}","gists_url":"https://api.github.com/users/vasslitvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/vasslitvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasslitvinov/subscriptions","organizations_url":"https://api.github.com/users/vasslitvinov/orgs","repos_url":"https://api.github.com/users/vasslitvinov/repos","events_url":"https://api.github.com/users/vasslitvinov/events{/privacy}","received_events_url":"https://api.github.com/users/vasslitvinov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vasslitvinov/chapel","description":"a Productive Parallel Programming Language","fork":true,"url":"https://api.github.com/repos/vasslitvinov/chapel","forks_url":"https://api.github.com/repos/vasslitvinov/chapel/forks","keys_url":"https://api.github.com/repos/vasslitvinov/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vasslitvinov/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vasslitvinov/chapel/teams","hooks_url":"https://api.github.com/repos/vasslitvinov/chapel/hooks","issue_events_url":"https://api.github.com/repos/vasslitvinov/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/vasslitvinov/chapel/events","assignees_url":"https://api.github.com/repos/vasslitvinov/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/vasslitvinov/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/vasslitvinov/chapel/tags","blobs_url":"https://api.github.com/repos/vasslitvinov/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vasslitvinov/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vasslitvinov/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/vasslitvinov/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vasslitvinov/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/vasslitvinov/chapel/languages","stargazers_url":"https://api.github.com/repos/vasslitvinov/chapel/stargazers","contributors_url":"https://api.github.com/repos/vasslitvinov/chapel/contributors","subscribers_url":"https://api.github.com/repos/vasslitvinov/chapel/subscribers","subscription_url":"https://api.github.com/repos/vasslitvinov/chapel/subscription","commits_url":"https://api.github.com/repos/vasslitvinov/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/vasslitvinov/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/vasslitvinov/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/vasslitvinov/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/vasslitvinov/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/vasslitvinov/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vasslitvinov/chapel/merges","archive_url":"https://api.github.com/repos/vasslitvinov/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vasslitvinov/chapel/downloads","issues_url":"https://api.github.com/repos/vasslitvinov/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/vasslitvinov/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/vasslitvinov/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/vasslitvinov/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vasslitvinov/chapel/labels{/name}","releases_url":"https://api.github.com/repos/vasslitvinov/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/vasslitvinov/chapel/deployments","created_at":"2014-07-16T19:46:44Z","updated_at":"2016-03-08T21:35:20Z","pushed_at":"2016-05-04T22:43:07Z","git_url":"git://github.com/vasslitvinov/chapel.git","ssh_url":"git@github.com:vasslitvinov/chapel.git","clone_url":"https://github.com/vasslitvinov/chapel.git","svn_url":"https://github.com/vasslitvinov/chapel","homepage":"http://chapel.cray.com/","size":359435,"stargazers_count":1,"watchers_count":1,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"chapel-lang:master","ref":"master","sha":"937f539185bb17d763d56c0bce9d1de40575a10d","user":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":21663285,"name":"chapel","full_name":"chapel-lang/chapel","owner":{"login":"chapel-lang","id":7597261,"avatar_url":"https://avatars.githubusercontent.com/u/7597261?v=3","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chapel-lang/chapel","description":"a Productive Parallel Programming Language","fork":false,"url":"https://api.github.com/repos/chapel-lang/chapel","forks_url":"https://api.github.com/repos/chapel-lang/chapel/forks","keys_url":"https://api.github.com/repos/chapel-lang/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/chapel/teams","hooks_url":"https://api.github.com/repos/chapel-lang/chapel/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/chapel/events","assignees_url":"https://api.github.com/repos/chapel-lang/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/chapel/tags","blobs_url":"https://api.github.com/repos/chapel-lang/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/chapel/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/chapel/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/chapel/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/chapel/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/chapel/subscription","commits_url":"https://api.github.com/repos/chapel-lang/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/chapel-lang/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/chapel/merges","archive_url":"https://api.github.com/repos/chapel-lang/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/chapel/downloads","issues_url":"https://api.github.com/repos/chapel-lang/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/chapel/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/chapel-lang/chapel/deployments","created_at":"2014-07-09T18:15:54Z","updated_at":"2016-04-30T16:38:08Z","pushed_at":"2016-05-05T15:03:33Z","git_url":"git://github.com/chapel-lang/chapel.git","ssh_url":"git@github.com:chapel-lang/chapel.git","clone_url":"https://github.com/chapel-lang/chapel.git","svn_url":"https://github.com/chapel-lang/chapel","homepage":"http://chapel.cray.com/","size":469608,"stargazers_count":257,"watchers_count":257,"language":"Chapel","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":16,"forks":101,"open_issues":16,"watchers":257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/3827"},"issue":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/3827"},"comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/3827/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/3827/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/chapel/statuses/df4955ec9481992ecb62a0feded83702c70eb7f4"}}}}