Hubbry Logo
search button
Sign in
Value semantics
Value semantics
Comunity Hub
History
arrow-down
starMore
arrow-down
bob

Bob

Have a question related to this hub?

bob

Alice

Got something to say related to this hub?
Share it here.

#general is a chat channel to discuss anything related to the hub.
Hubbry Logo
search button
Sign in
Value semantics
Community hub for the Wikipedia article
logoWikipedian hub
Welcome to the community hub built on top of the Value semantics Wikipedia article. Here, you can discuss, collect, and organize anything related to Value semantics. The purpose of the hub is to connect p...
Add your contribution
Value semantics

In computer science, having value semantics (also value-type semantics or copy-by-value semantics) means for an object that only its value counts, not its identity.[1][2] Immutable objects have value semantics trivially,[3] and in the presence of mutation, an object with value semantics can only be uniquely-referenced at any point in a program.

The concepts that are used to explain this concept are extensionality, definiteness, substitutivity of identity, unfoldability, and referential transparency.[4]

References

[edit]
  1. ^ "Some Basic QUESTIONS". velocity reviews. Retrieved 2011-06-17. The important consideration for value semantics is that only the value of an object is significant, not its identity. So you can copy it (copy constructor or assignment) as much as you like, and any copy can be used in place of the original with no change.
  2. ^ Daniel Elstner. "Re: extending Gdk::Region". GTK & GNOME Mailing Lists. Retrieved 2011-06-17. What are value semantics? [...] It's an ad hoc shorthand for "value-type semantics", or "copy-by-value semantics".
  3. ^ "Some Basic QUESTIONS". velocity reviews. Archived from the original on 2012-03-29. Retrieved 2011-06-17. An object represents an immutable value (vs. an object represents a system with a mutable state.) [...] Not necessarily, at least not in C++. I do like the idea that an object with value semantics can only be modified by the assignment operators, but this is far from the general case---std::string, for example, clearly has value semantics, despite a large number of mutator functions. (One can argue that this is a design error, but if so, it's still one we have to live with.){{cite web}}: CS1 maint: bot: original URL status unknown (link)
  4. ^ "Some Basic QUESTIONS". velocity reviews. The important consideration for value semantics is that only the value of an object is significant, not its identity. So you can copy it (copy constructor or assignment) as much as you like, [...] One can eventually identify five different concepts that can be used to explain this notion in a more precise manner, these are: extensionality, definiteness, substitutivity of identity, unfoldability, and referential transparency.