{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1228","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1228/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1228/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1228/events","html_url":"https://github.com/rust-lang/rfcs/pull/1228","id":97764509,"number":1228,"title":"Place left arrow syntax (`place <- expr`)","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/T-lang","name":"T-lang","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":8,"created_at":"2015-07-28T17:59:32Z","updated_at":"2015-07-28T22:05:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1228","html_url":"https://github.com/rust-lang/rfcs/pull/1228","diff_url":"https://github.com/rust-lang/rfcs/pull/1228.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1228.patch"},"body":"## Summary\r\n\r\nRather than trying to find a clever syntax for placement-new that leverages\r\nthe `in` keyword, instead use the syntax `PLACE_EXPR <- VALUE_EXPR`.\r\n\r\nThis takes advantage of the fact that `<-` was reserved as a token via\r\nhistorical accident (that for once worked out in our favor).\r\n\r\n[rendered draft](https://github.com/pnkfelix/rfcs/blob/place-left-arrow-syntax/text/0000-placement-left-arrow.md)."},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/125766946","html_url":"https://github.com/rust-lang/rfcs/pull/1228#issuecomment-125766946","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1228","id":125766946,"user":{"login":"petrochenkov","id":5751617,"avatar_url":"https://avatars.githubusercontent.com/u/5751617?v=3","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T22:05:57Z","updated_at":"2015-07-28T22:05:57Z","body":"Yay!\r\n\r\n@nagisa @aturon \r\nIt's not `Box`, but other containers, who will benefit most from this change.\r\n\r\nFor example, emplacement into `Vec`:\r\n```\r\nlet v = Vec::new();\r\n// The old syntax\r\nin v.back() { 10 };\r\n// The new syntax. \r\nv.back() <- 10; // This clearly looks better to me.\r\n```\r\nor emplacement into `HashSet`:\r\n```\r\nlet s = HashSet::new();\r\n// The old syntax\r\nin s.new_place() { 10 }; \r\nin s {10}; // If the set itself can be a \"place\"\r\n// The new syntax\r\ns.new_place() <- 10;\r\ns <- 10; // Yep, much better\r\n```\r\n\r\nIdeally, a couple of basic containers (`Vec`, `HashMap`, `HashSet`) should get actually working emplacement interfaces before finalizing the emplacement syntax. Does the current state of implementation (i.e. https://github.com/rust-lang/rust/pull/27215) allow implementing such interfaces? (I haven't digged into it yet.)"}}