{"action":"closed","number":1748,"pull_request":{"url":"https://api.github.com/repos/nitlang/nit/pulls/1748","id":46980552,"html_url":"https://github.com/nitlang/nit/pull/1748","diff_url":"https://github.com/nitlang/nit/pull/1748.diff","patch_url":"https://github.com/nitlang/nit/pull/1748.patch","issue_url":"https://api.github.com/repos/nitlang/nit/issues/1748","number":1748,"state":"closed","locked":false,"title":"Multi iterators","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"body":"Introduce multi-iterators in `for`.\r\n\r\nA single `for` can now iterates over more than one collection at once. An iterator is used for each collection and the iteration is finished once the shortest iterator is finished.\r\n\r\n~~~nit\r\nfor i in [10, 20, 30], j in [1..10] do print i+j # outputs 11 22 33\r\n~~~\r\n\r\nAs expected by POLA, multi-iterators are also naturally usable on maps and comprehension arrays\r\n\r\n~~~nit\r\nvar m = new HashMap[Int,String]\r\nm[1] = \"one\"\r\nm[2] = \"two\"\r\nfor k, v in m, i in [1..10] do print \"{k}:{v}:{i}\"\r\n# outputs 1:one:1 2:two:2\r\n\r\nvar a = [for i in [10, 20, 30], j in [1..10] do i + j]\r\nprint a # outputs [11, 22, 33]\r\n~~~\r\n\r\nClose #1735","created_at":"2015-10-07T02:16:57Z","updated_at":"2015-10-07T20:04:38Z","closed_at":"2015-10-07T20:04:38Z","merged_at":"2015-10-07T20:04:38Z","merge_commit_sha":"5f66e67a3376e5d04167ae00c9d2c6e992b13d19","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nitlang/nit/pulls/1748/commits","review_comments_url":"https://api.github.com/repos/nitlang/nit/pulls/1748/comments","review_comment_url":"https://api.github.com/repos/nitlang/nit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nitlang/nit/issues/1748/comments","statuses_url":"https://api.github.com/repos/nitlang/nit/statuses/dd768ed899d5b128309859ed2187a453a4630a8c","head":{"label":"privat:multi-iterators","ref":"multi-iterators","sha":"dd768ed899d5b128309859ed2187a453a4630a8c","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":41187555,"name":"mynit","full_name":"privat/mynit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/mynit","description":"Nit language","fork":true,"url":"https://api.github.com/repos/privat/mynit","forks_url":"https://api.github.com/repos/privat/mynit/forks","keys_url":"https://api.github.com/repos/privat/mynit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/mynit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/mynit/teams","hooks_url":"https://api.github.com/repos/privat/mynit/hooks","issue_events_url":"https://api.github.com/repos/privat/mynit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/mynit/events","assignees_url":"https://api.github.com/repos/privat/mynit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/mynit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/mynit/tags","blobs_url":"https://api.github.com/repos/privat/mynit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/mynit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/mynit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/mynit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/mynit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/mynit/languages","stargazers_url":"https://api.github.com/repos/privat/mynit/stargazers","contributors_url":"https://api.github.com/repos/privat/mynit/contributors","subscribers_url":"https://api.github.com/repos/privat/mynit/subscribers","subscription_url":"https://api.github.com/repos/privat/mynit/subscription","commits_url":"https://api.github.com/repos/privat/mynit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/mynit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/mynit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/mynit/issues/comments{/number}","contents_url":"https://api.github.com/repos/privat/mynit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/mynit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/mynit/merges","archive_url":"https://api.github.com/repos/privat/mynit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/mynit/downloads","issues_url":"https://api.github.com/repos/privat/mynit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/mynit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/mynit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/mynit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/mynit/labels{/name}","releases_url":"https://api.github.com/repos/privat/mynit/releases{/id}","created_at":"2015-08-22T03:08:04Z","updated_at":"2015-08-22T03:09:37Z","pushed_at":"2015-10-07T15:55:00Z","git_url":"git://github.com/privat/mynit.git","ssh_url":"git@github.com:privat/mynit.git","clone_url":"https://github.com/privat/mynit.git","svn_url":"https://github.com/privat/mynit","homepage":"http://nitlanguage.org","size":71727,"stargazers_count":0,"watchers_count":0,"language":"C","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":0,"default_branch":"master"}},"base":{"label":"nitlang:master","ref":"master","sha":"a662896faea407d32bb71a2b86742a5300bbe7d1","user":{"login":"nitlang","id":5420298,"avatar_url":"https://avatars.githubusercontent.com/u/5420298?v=3","gravatar_id":"","url":"https://api.github.com/users/nitlang","html_url":"https://github.com/nitlang","followers_url":"https://api.github.com/users/nitlang/followers","following_url":"https://api.github.com/users/nitlang/following{/other_user}","gists_url":"https://api.github.com/users/nitlang/gists{/gist_id}","starred_url":"https://api.github.com/users/nitlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitlang/subscriptions","organizations_url":"https://api.github.com/users/nitlang/orgs","repos_url":"https://api.github.com/users/nitlang/repos","events_url":"https://api.github.com/users/nitlang/events{/privacy}","received_events_url":"https://api.github.com/users/nitlang/received_events","type":"Organization","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"nitlang/nit","owner":{"login":"nitlang","id":5420298,"avatar_url":"https://avatars.githubusercontent.com/u/5420298?v=3","gravatar_id":"","url":"https://api.github.com/users/nitlang","html_url":"https://github.com/nitlang","followers_url":"https://api.github.com/users/nitlang/followers","following_url":"https://api.github.com/users/nitlang/following{/other_user}","gists_url":"https://api.github.com/users/nitlang/gists{/gist_id}","starred_url":"https://api.github.com/users/nitlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitlang/subscriptions","organizations_url":"https://api.github.com/users/nitlang/orgs","repos_url":"https://api.github.com/users/nitlang/repos","events_url":"https://api.github.com/users/nitlang/events{/privacy}","received_events_url":"https://api.github.com/users/nitlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nitlang/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/nitlang/nit","forks_url":"https://api.github.com/repos/nitlang/nit/forks","keys_url":"https://api.github.com/repos/nitlang/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nitlang/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nitlang/nit/teams","hooks_url":"https://api.github.com/repos/nitlang/nit/hooks","issue_events_url":"https://api.github.com/repos/nitlang/nit/issues/events{/number}","events_url":"https://api.github.com/repos/nitlang/nit/events","assignees_url":"https://api.github.com/repos/nitlang/nit/assignees{/user}","branches_url":"https://api.github.com/repos/nitlang/nit/branches{/branch}","tags_url":"https://api.github.com/repos/nitlang/nit/tags","blobs_url":"https://api.github.com/repos/nitlang/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nitlang/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nitlang/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/nitlang/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nitlang/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/nitlang/nit/languages","stargazers_url":"https://api.github.com/repos/nitlang/nit/stargazers","contributors_url":"https://api.github.com/repos/nitlang/nit/contributors","subscribers_url":"https://api.github.com/repos/nitlang/nit/subscribers","subscription_url":"https://api.github.com/repos/nitlang/nit/subscription","commits_url":"https://api.github.com/repos/nitlang/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/nitlang/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/nitlang/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/nitlang/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/nitlang/nit/contents/{+path}","compare_url":"https://api.github.com/repos/nitlang/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nitlang/nit/merges","archive_url":"https://api.github.com/repos/nitlang/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nitlang/nit/downloads","issues_url":"https://api.github.com/repos/nitlang/nit/issues{/number}","pulls_url":"https://api.github.com/repos/nitlang/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/nitlang/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/nitlang/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nitlang/nit/labels{/name}","releases_url":"https://api.github.com/repos/nitlang/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2015-09-10T13:33:12Z","pushed_at":"2015-10-07T20:04:37Z","git_url":"git://github.com/nitlang/nit.git","ssh_url":"git@github.com:nitlang/nit.git","clone_url":"https://github.com/nitlang/nit.git","svn_url":"https://github.com/nitlang/nit","homepage":"http://nitlanguage.org","size":100228,"stargazers_count":78,"watchers_count":78,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":44,"mirror_url":null,"open_issues_count":113,"forks":44,"open_issues":113,"watchers":78,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nitlang/nit/pulls/1748"},"html":{"href":"https://github.com/nitlang/nit/pull/1748"},"issue":{"href":"https://api.github.com/repos/nitlang/nit/issues/1748"},"comments":{"href":"https://api.github.com/repos/nitlang/nit/issues/1748/comments"},"review_comments":{"href":"https://api.github.com/repos/nitlang/nit/pulls/1748/comments"},"review_comment":{"href":"https://api.github.com/repos/nitlang/nit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nitlang/nit/pulls/1748/commits"},"statuses":{"href":"https://api.github.com/repos/nitlang/nit/statuses/dd768ed899d5b128309859ed2187a453a4630a8c"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":12,"additions":8826,"deletions":8636,"changed_files":33}}