-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update *reference* definition to make it clearer in chapter 4.2 #3193
Conversation
Can you clarify what you found to be unclear about the original and what is clearer to you about the new version? |
@carols10cents
In the new version, the flow of the sentence is simple, which makes it easier to understand the underlying concept
|
@carols10cents Any updates on this? |
I'm working on updating the book for print and I'll get to this the next time I'm revising chapter 4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good proposal, but I think we can untangle it a bit more. how about?:
Like a pointer, a reference holds the address to data owned by another variable, we can follow it to access the data.
Unlike a pointer ....
That can undermine the "definition" of the word reference in a sense, i.e what the word reference actually means, So what about.. "A reference is like a pointer, i.e a variable that stores the address of the data owned by another variable; An address that we can follow in order to access the data stored at that address (data, which is owned by some other variable). However, unlike a pointer, a reference is guaranteed to point to a valid value of a |
@vinsburg Any updates on this? |
Sorry, busy week :) |
Yes! Although, keeping the duplication might help clarify the point since it can mean the reference variable itself or the variable that it's pointing to, and it can be a bit vague. It's better to be explicit, just like most things in Rust ;) |
@troglodytto I think both approaches are plausible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I am noting this section to make sure Carol or I look at it again as we do revisions, but in the case of this specific PR, I think the new text is pretty similar to the old text in terms of how clear it is. If we decide to tackle this in some way, we will likely rewrite the sentences entirely rather than just tweaking the wording. (This is by no means a commitment to doing that, though; we may decide it is just best left as it is!) Thanks again.
No description provided.