{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/961","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/961/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/961/events","html_url":"https://github.com/rust-lang/rfcs/issues/961","id":60580182,"number":961,"title":"Allow loops to return values other than ()","user":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/postponed","name":"postponed","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":42,"created_at":"2015-03-10T22:28:37Z","updated_at":"2016-02-20T17:44:00Z","closed_at":null,"body":"Extend for, loop, and while loops to allow them to return values other than ():\r\n\r\n   * add an optional else clause that is evaluated if the loop ended without using break;\r\n   * add an optional expression parameter to break expressions to break out of a loop with a value.\r\n\r\nProposed in #352 \r\n\r\nSome discussion of future-proofing is available in #955 "},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/186657973","html_url":"https://github.com/rust-lang/rfcs/issues/961#issuecomment-186657973","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/961","id":186657973,"user":{"login":"peterjoel","id":150875,"avatar_url":"https://avatars.githubusercontent.com/u/150875?v=3","gravatar_id":"","url":"https://api.github.com/users/peterjoel","html_url":"https://github.com/peterjoel","followers_url":"https://api.github.com/users/peterjoel/followers","following_url":"https://api.github.com/users/peterjoel/following{/other_user}","gists_url":"https://api.github.com/users/peterjoel/gists{/gist_id}","starred_url":"https://api.github.com/users/peterjoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterjoel/subscriptions","organizations_url":"https://api.github.com/users/peterjoel/orgs","repos_url":"https://api.github.com/users/peterjoel/repos","events_url":"https://api.github.com/users/peterjoel/events{/privacy}","received_events_url":"https://api.github.com/users/peterjoel/received_events","type":"User","site_admin":false},"created_at":"2016-02-20T17:44:00Z","updated_at":"2016-02-20T17:44:00Z","body":"> if you don’t break, what will the loop evaluate to?\r\n\r\nI entered this from a discussion which was not considering making loops into expressions."}}