{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/2584","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2584/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2584/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2584/events","html_url":"https://github.com/rust-lang/rfcs/pull/2584","id":376962377,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MDU1MDM2","number":2584,"title":"RFC: Structural Records","user":{"login":"Centril","id":855702,"node_id":"MDQ6VXNlcjg1NTcwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/855702?v=4","gravatar_id":"","url":"https://api.github.com/users/Centril","html_url":"https://github.com/Centril","followers_url":"https://api.github.com/users/Centril/followers","following_url":"https://api.github.com/users/Centril/following{/other_user}","gists_url":"https://api.github.com/users/Centril/gists{/gist_id}","starred_url":"https://api.github.com/users/Centril/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Centril/subscriptions","organizations_url":"https://api.github.com/users/Centril/orgs","repos_url":"https://api.github.com/users/Centril/repos","events_url":"https://api.github.com/users/Centril/events{/privacy}","received_events_url":"https://api.github.com/users/Centril/received_events","type":"User","site_admin":false},"labels":[{"id":211667886,"node_id":"MDU6TGFiZWwyMTE2Njc4ODY=","url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-lang","name":"T-lang","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2018-11-02T20:47:28Z","updated_at":"2018-11-04T23:05:38Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/2584","html_url":"https://github.com/rust-lang/rfcs/pull/2584","diff_url":"https://github.com/rust-lang/rfcs/pull/2584.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/2584.patch"},"body":"### [🖼️ Rendered](https://github.com/Centril/rfcs/blob/rfc/structural-records/text/0000-structural-records.md)\r\n\r\n### 📝 Summary\r\n\r\n**Introduce _structural records_** of the form `{ foo: 1u8, bar: true }` of type `{ foo: u8, bar: bool }` into the language. Another way to understand these sorts of objects is to think of them as *\"tuples with named fields\"*, *\"unnamed structs\"*, or *\"anonymous structs\"*.\r\n\r\n### 💖 Thanks\r\n\r\nTo @kennytm, @alexreg, @Nemo157, and @tinaun for reviewing the draft version of this RFC.\r\nTo @varkor and @pnkfelix for good and helpful discussions."},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/435717151","html_url":"https://github.com/rust-lang/rfcs/pull/2584#issuecomment-435717151","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2584","id":435717151,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTcxNzE1MQ==","user":{"login":"leonardo-m","id":22328461,"node_id":"MDQ6VXNlcjIyMzI4NDYx","avatar_url":"https://avatars0.githubusercontent.com/u/22328461?v=4","gravatar_id":"","url":"https://api.github.com/users/leonardo-m","html_url":"https://github.com/leonardo-m","followers_url":"https://api.github.com/users/leonardo-m/followers","following_url":"https://api.github.com/users/leonardo-m/following{/other_user}","gists_url":"https://api.github.com/users/leonardo-m/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardo-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardo-m/subscriptions","organizations_url":"https://api.github.com/users/leonardo-m/orgs","repos_url":"https://api.github.com/users/leonardo-m/repos","events_url":"https://api.github.com/users/leonardo-m/events{/privacy}","received_events_url":"https://api.github.com/users/leonardo-m/received_events","type":"User","site_admin":false},"created_at":"2018-11-04T23:05:38Z","updated_at":"2018-11-04T23:05:38Z","author_association":"NONE","body":"Code like this is quite bad, the fields named are usually longer than just three letters, it will often lead to too much large signatures:\r\n\r\n> fn do_stuff_with(color: { red: u8, green: u8, blue: u8 }) {\r\n\r\n> As we can see, the current situation is inconsistent. While the language provides for unit types and positional product types of both the nominal and structural flavour, the structural variant of structs with named fields is missing while the nominal type exists. A consistent programming language is a beautiful language, but it's not an end in itself. Instead, the main benefit is to reduce surprises for learners.\r\n\r\nThis is a bogus argument. It's not like searching for symmetries in quantum physics. In language design symmetries can't be used to justify adding a feature. If a feature is useful then it could be added, but not just because a cell in a feature matrix is still empty. So please remove this part from the proposal."}}
{"actor":{"display_login":"leonardo-m"}}