Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
complexvalues [2021/02/05 17:36] christian [Anatomy of a Value] |
complexvalues [2022/03/06 08:57] christian [Values] |
||
---|---|---|---|
Line 4: | Line 4: | ||
Features: | Features: | ||
- | * Values as known in the functional world: immutable and consisting only of values or primitive types. Values do not have an identity and are equal when their elements are equal. A Value always forms a simple tree without loops or references. Instead of mutating objects, values are copied with new elements. Values are created with a constructor taking all elements as arguments. | + | * Values as known in the functional world: |
- | * Literal: every value can print itself '' | + | |
- | * Defaults: elements can have a default, so that they can be omited in the constructor. This simplifies systems, since only the relevant data has to be given and the defaults are hidden. | + | |
- | * Named Values: some instances of a value class may be well known and should be use in the code instead of the generic constructor. This feature should be used with caution, since changes will break code using obsolete instances. Currently, only '' | + | |
==== Motivation ==== | ==== Motivation ==== | ||