{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/6400","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400/events","html_url":"https://github.com/dotnet/roslyn/issues/6400","id":113917694,"number":6400,"title":"Proposal: Destructuring (assignment?) statement","user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Feature%20Request","name":"Feature Request","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/8","html_url":"https://github.com/dotnet/roslyn/milestones/C%23%207%20and%20VB%2015","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/8/labels","id":962632,"number":8,"title":"C# 7 and VB 15","description":"\r\n\r\n<!---\r\n@huboard:{\"order\":0.375}\r\n-->\r\n","creator":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"open_issues":61,"closed_issues":10,"state":"open","created_at":"2015-02-02T23:41:34Z","updated_at":"2015-10-28T20:42:29Z","due_on":null,"closed_at":null},"comments":30,"created_at":"2015-10-28T20:42:20Z","updated_at":"2015-10-29T15:50:06Z","closed_at":null,"body":"Inspired by an [F# feature](https://msdn.microsoft.com/en-us/library/dd233238.aspx) and a [conversation on another issue](https://github.com/dotnet/roslyn/issues/5154#issuecomment-151974994), we could support tuple decomposition like this:\r\n\r\n> *block-statement:*\r\n&nbsp;&nbsp;&nbsp;&nbsp;*let-statement*\r\n*let-statement:*\r\n&nbsp;&nbsp;&nbsp;&nbsp;`let` *pattern* `=` *expression* `;`\r\n\r\n`let` is a new keyword (or perhaps contextual keyword).\r\n\r\nSemantically, it is an error if the compiler cannot prove that the expression always matches the pattern. Any pattern variables in the *pattern* are in scope throughout the enclosing block and are definitely assigned (only) after the execution of the *let-statement* completes.\r\n\r\nThis would apply to tuples as follows. Given\r\n\r\n```cs\r\npublic (int, int) ComputePoint() => …\r\n```\r\n\r\nYou could receive the results into a block scope thusly\r\n\r\n```cs\r\n\tlet (int x, int y) = ComputePoint();\r\n```\r\n\r\nA side-effect of this proposal is that it gives you a way to declare read-only locals (pattern variables are currently proposed to be readonly):\r\n\r\n```cs\r\n\tlet var x = expression;\r\n```\r\n\r\nWe could add an identifier-only version as F# does as well:\r\n\r\n```cs\r\n\tlet x = expression;\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/152222137","html_url":"https://github.com/dotnet/roslyn/issues/6400#issuecomment-152222137","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6400","id":152222137,"user":{"login":"FunctionalFirst","id":1117464,"avatar_url":"https://avatars.githubusercontent.com/u/1117464?v=3","gravatar_id":"","url":"https://api.github.com/users/FunctionalFirst","html_url":"https://github.com/FunctionalFirst","followers_url":"https://api.github.com/users/FunctionalFirst/followers","following_url":"https://api.github.com/users/FunctionalFirst/following{/other_user}","gists_url":"https://api.github.com/users/FunctionalFirst/gists{/gist_id}","starred_url":"https://api.github.com/users/FunctionalFirst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FunctionalFirst/subscriptions","organizations_url":"https://api.github.com/users/FunctionalFirst/orgs","repos_url":"https://api.github.com/users/FunctionalFirst/repos","events_url":"https://api.github.com/users/FunctionalFirst/events{/privacy}","received_events_url":"https://api.github.com/users/FunctionalFirst/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T15:50:06Z","updated_at":"2015-10-29T15:50:06Z","body":"@alrz You missed my point. I'm not suggesting active patterns are the right way to solve your example problem. Rather, the bool-returning `is` operator closely corresponds to active patterns, and active patterns never form a complete match. A wildcard match is always required."}}