{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/13","repository_url":"https://api.github.com/repos/rust-lang-nursery/reference","labels_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/13/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/13/events","html_url":"https://github.com/rust-lang-nursery/reference/pull/13","id":214500382,"number":13,"title":"[WIP] Expressions rewrite","user":{"login":"matthewjasper","id":20113453,"avatar_url":"https://avatars2.githubusercontent.com/u/20113453?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewjasper","html_url":"https://github.com/matthewjasper","followers_url":"https://api.github.com/users/matthewjasper/followers","following_url":"https://api.github.com/users/matthewjasper/following{/other_user}","gists_url":"https://api.github.com/users/matthewjasper/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewjasper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewjasper/subscriptions","organizations_url":"https://api.github.com/users/matthewjasper/orgs","repos_url":"https://api.github.com/users/matthewjasper/repos","events_url":"https://api.github.com/users/matthewjasper/events{/privacy}","received_events_url":"https://api.github.com/users/matthewjasper/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-03-15T19:28:54Z","updated_at":"2017-06-01T18:36:59Z","closed_at":"2017-06-01T14:55:00Z","pull_request":{"url":"https://api.github.com/repos/rust-lang-nursery/reference/pulls/13","html_url":"https://github.com/rust-lang-nursery/reference/pull/13","diff_url":"https://github.com/rust-lang-nursery/reference/pull/13.diff","patch_url":"https://github.com/rust-lang-nursery/reference/pull/13.patch"},"body":"So this is a WIP attempt to improve the expressions section. It documents more features, fixes inaccuracies and hopefully makes things clearer. All feedback is welcome.\r\n\r\n## Changes\r\n\r\n* General\r\n    * Always wrap at 80 characters\r\n    * Make more things links\r\n* Structs\r\n    * State that struct expressions can't be used in control flow expressions\r\n* Methods\r\n    * Add examples for methods\r\n    * Explained auto-deref\r\n        * <s>UFCS (or whatever it's called now) isn't in the reference!!!</s> It has a PR now.\r\n* Fields\r\n    * Show the syntax for calling a struct field\r\n* Calls\r\n    * Move before operators\r\n    * Explain the function call syntax\r\n    * Mention `Fn` traits\r\n* Lambdas\r\n    * Move lambda section\r\n    * Lambdas have unique types\r\n    * `move` is part of the lambda expression according to libsyntax, so I'm going with that\r\n    * Explain that `move` can extend the lifetime of the closure\r\n    * Use closure, except when followed by 'expression'\r\n    * Closure traits depend on how captures are used, not on how they are captured\r\n* Arrays\r\n    * Explain what arrays expressions do\r\n    * `static`s aren't constant expressions\r\n    * Explain `Copy` requirement\r\n* Index\r\n    * Specify how overloading is done\r\n    * Indices must be of type `usize`\r\n* Unary operators\r\n    * Explained `std::ops::Neg`\r\n    * Hopefully made it clearer how `Deref` works\r\n    * Explained `std::ops::Not`\r\n    * Say that `&mut` can't be applied to everything\r\n* Binary operators\r\n    * Merge with unary operators\r\n    * Built in operators don't use traits\r\n    * Show all of the operators in examples\r\n    * Put all of this into a table, to avoid having to repeat so many words.\r\n* Compound assignments\r\n    * Explain overloading of these operators\r\n* Precedence\r\n    * Add unary operators\r\n    * Show the correct associativity\r\n* Grouped expressions\r\n    * Better example\r\n* Loops and control flow.\r\n    * Use 'then' instead of and for sequenced operations in `while` loops\r\n    * State that all loops return `()` (Except `loop` but that's in another PR)\r\n    * Add some more examples\r\n    * Don't use 'identical' for things that aren't (would also need to look at #47 in this respect)\r\n    * Make the definition of `if let` and `while let` clearer\r\n\r\nUpdate:\r\n\r\n* Further Changes\r\n    * Mention array to slice coercions happening in method calls.\r\n    * Use 'mutable lvalue (context)' to describe some things. (I have no idea if this is how it should be described, but this was the easiest way to describe the behaviour that I tested).\r\n    * Explain when lvalues can be moved out of. (or, how not to do a move semantics tutorial)\r\n    * Explain that most things are actually in `libcore`, in only one place.\r\n    * Explicitly say that blocks are rvalues.\r\n    * Say exactly what operations are overflow.\r\n    * Say some things about implicit borrows.\r\n    * Add examples to show what is meant by method 'receiver'.\r\n    * Explain when fields can be viewed as separate entities for borrows and moves.\r\n    * Note that methods don't use lifetimes, mutability or safety to help with resolution.\r\n    * Say that paths to `static mut` require unsafe in this chapter.\r\n    * Enums variants can also be used in 'struct expressions'\r\n    * Mention tuple indexing.\r\n    * Mention that generic traits and methods are considered to be one trait for method resolution\r\n    * Show some paths with `::` in path expressions section.\r\n    * Document const expr (including RFC 71)\r\n    * Document casts, sort of.\r\n    * RFC 736 - Privacy respecting Functional Record Update (FRU)\r\n    * RFC 968 - Closure return type syntax\r\n    * RFC 1229 - Compile time asserts\r\n    * RFC 1535 - Stable overflow checks\r\n\r\nI'll probably split this up into pieces that can more easily be reviewed and avoid blocking everything on the lang team explaining how lvalues actually work."},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/comments/305581867","html_url":"https://github.com/rust-lang-nursery/reference/pull/13#issuecomment-305581867","issue_url":"https://api.github.com/repos/rust-lang-nursery/reference/issues/13","id":305581867,"user":{"login":"steveklabnik","id":27786,"avatar_url":"https://avatars1.githubusercontent.com/u/27786?v=3","gravatar_id":"","url":"https://api.github.com/users/steveklabnik","html_url":"https://github.com/steveklabnik","followers_url":"https://api.github.com/users/steveklabnik/followers","following_url":"https://api.github.com/users/steveklabnik/following{/other_user}","gists_url":"https://api.github.com/users/steveklabnik/gists{/gist_id}","starred_url":"https://api.github.com/users/steveklabnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveklabnik/subscriptions","organizations_url":"https://api.github.com/users/steveklabnik/orgs","repos_url":"https://api.github.com/users/steveklabnik/repos","events_url":"https://api.github.com/users/steveklabnik/events{/privacy}","received_events_url":"https://api.github.com/users/steveklabnik/received_events","type":"User","site_admin":false},"created_at":"2017-06-01T18:36:59Z","updated_at":"2017-06-01T18:36:59Z","body":"@matthewjasper that'd be great if you have the chance; I just pushed a commit fixing some of them If you have the chance to take the rest, that'd be great! I'd like to get this done today since tomorrow is the cutoff for beta; https://github.com/rust-lang/rust/pull/42353 is the actual PR."}}
{"actor":{"display_login":"steveklabnik"}}