-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Rc/Arc: get rid of "value" terminology #64484
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Type
Fields
Give feedbackNo fields configured for issues without a type.
The Rc docs use the term "value" to refer to an
RcBoxinstance (and similar forArc). That's IMO a bad use of terminology: A "value" is something like "5" or "true" that does not have an identity beyond its mathematical interpretation; anRcBoxhas a location so that even two distinctRcBoxthat contain the same value (say, both contain "5") are "not the same".This is particularly bad in the docs for
ptr_eq:"5" and "5" are the same value, and yet
Rc::ptr_eq(&Rc::new(5), &Rc::new(5))returnsfalse. So IMO the docs are just wrong -- or rather, they are using the term "value" in the wrong way.I suggest that we replace all/most uses of "value" in these docs by "reference-counted object" or maybe something involving "instance". I think that better conveys what is happening.
Opinions? Cc @Centril @SimonSapin @gnzlbg