cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
506 stars 82 forks source link

Confusing use of the word "path" in ch04-02 #54

Closed dyslexicsteak closed 1 year ago

dyslexicsteak commented 1 year ago

URL to the section(s) of the book with this problem: https://github.com/cognitive-engineering-lab/rust-book/blob/main/src/ch04-02-references-and-borrowing.md

Description of the problem: The word "path" is used extensively in the "references and borrowing" section in chapter 4 to seemingly reference the concept of a "place" in Rust ("lvalue" in C++) AKA an addressable value. The use of the word in this way is bound to cause confusion with readers of the book when speaking about these "paths" outside and inside the context of the book; the word "path" in Rust is generally used to refer to module paths or file system paths, and the book later uses them to refer to module paths.

Suggested fix: Replace the word "path" with the more accurate and clear word "place".

willcrichton commented 1 year ago

I agree the term path is a bit overloaded, in particular with the concept of module paths. The origin of the term comes from Polonius, which uses "path": https://github.com/rust-lang/polonius/blob/master/src/facts.rs#L48

I don't think the term "place" is really standardized for Rust outside the context of the MIR, but if there were a generally accepted term, I would just use that.

dyslexicsteak commented 1 year ago

I don't think the term "place" is really standardized for Rust outside the context of the MIR, but if there were a generally accepted term, I would just use that.

Even if it is so, I think it's fine. I'll open a PR which changes it, and any further discussion (if any) can take place there.