{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/1725","repository_url":"https://api.github.com/repos/dotnet/csharplang","labels_url":"https://api.github.com/repos/dotnet/csharplang/issues/1725/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/csharplang/issues/1725/comments","events_url":"https://api.github.com/repos/dotnet/csharplang/issues/1725/events","html_url":"https://github.com/dotnet/csharplang/issues/1725","id":342118844,"node_id":"MDU6SXNzdWUzNDIxMTg4NDQ=","number":1725,"title":"[Proposal] Assigning one value to all items in a tuple","user":{"login":"AustinBryan","id":16201886,"node_id":"MDQ6VXNlcjE2MjAxODg2","avatar_url":"https://avatars1.githubusercontent.com/u/16201886?v=4","gravatar_id":"","url":"https://api.github.com/users/AustinBryan","html_url":"https://github.com/AustinBryan","followers_url":"https://api.github.com/users/AustinBryan/followers","following_url":"https://api.github.com/users/AustinBryan/following{/other_user}","gists_url":"https://api.github.com/users/AustinBryan/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinBryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinBryan/subscriptions","organizations_url":"https://api.github.com/users/AustinBryan/orgs","repos_url":"https://api.github.com/users/AustinBryan/repos","events_url":"https://api.github.com/users/AustinBryan/events{/privacy}","received_events_url":"https://api.github.com/users/AustinBryan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-17T23:00:42Z","updated_at":"2018-07-21T17:06:30Z","closed_at":null,"author_association":"NONE","body":"### Problem:\r\nIt feels sort've redundant to do something like \r\n\r\n```csharp\r\n(X, Y, Z) = forceCube ? (GetSizeForX(), GetSizeForY(), GetSizeForZ()) : (GetSizeForX(), GetSizeForX(), GetSizeForX())\r\n```\r\n\r\nWhere each item is getting the same value. \r\n\r\n### Purposed Solution:\r\nSo what if there was a way we could write something like this:\r\n\r\n```csharp\r\n(X, Y, Z) = forceCube ? (GetSizeForX(), GetSizeForY(), GetSizeForZ()) : GetSizeForX();\r\n```\r\n\r\nAnd `true` will be assigned to all three variables. This makes the code shorter, easier to read, and if I decide later I want them to all start off as false, I change it in only one place.\r\n\r\n### **Questions:**\r\n\r\nIf someone did\r\n```csharp\r\n(List1, List2, List3) = new List<int>();\r\n// instead of:\r\n(List1, List2, List3) = (new List<int>(), new List<int>(), new List<int>());\r\n```\r\n\r\nDo they all have their own `List<int>()` (meaning the right hand of the assignment gets executed once for each item in the tuple) or they all share the same reference to that one list? (meaning the right hand gets executed only once in total). I think it would be more useful if they each got their own `List<int>` so that way we could quickly and easily initialize multiple variables of the same time. \r\n\r\n**EDIT:** Made better example"},"comment":{"url":"https://api.github.com/repos/dotnet/csharplang/issues/comments/406810183","html_url":"https://github.com/dotnet/csharplang/issues/1725#issuecomment-406810183","issue_url":"https://api.github.com/repos/dotnet/csharplang/issues/1725","id":406810183,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjgxMDE4Mw==","user":{"login":"jnm2","id":8040367,"node_id":"MDQ6VXNlcjgwNDAzNjc=","avatar_url":"https://avatars2.githubusercontent.com/u/8040367?v=4","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"created_at":"2018-07-21T17:06:30Z","updated_at":"2018-07-21T17:06:30Z","author_association":"CONTRIBUTOR","body":"The bottom line gives me the impression that it's trying to smooth over something inherently arbitrary and make it look fundamental."}}
{"actor":{"display_login":"jnm2"}}