값 의미론
Value semantics컴퓨터 과학에서, 가치 의미론(가치 유형 의미론 또는 값별 복사 의미론)을 갖는다는 것은 그것의 [1][2]정체성이 아니라 그것의 값만 중요한 객체에 대한 것을 의미합니다.불변의 객체는 3차적으로 [3]가치의 의미를 가지며, 변환이 존재하는 경우, 가치의 의미를 갖는 객체는 프로그램 내의 임의의 지점에서만 고유하게 참조될 수 있다.
이 개념을 설명하기 위해 사용되는 개념은 확장성, 정의성, 동일성의 대체성, 전개성 및 참조 [4]투명성이다.
레퍼런스
- ^ "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.
- ^ 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".
- ^ "Some Basic QUESTIONS". velocity reviews. 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.)
- ^ "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.