rfc:structs-v2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:structs-v2 [2024/04/23 16:32] – ilutov | rfc:structs-v2 [2024/04/24 20:33] (current) – ilutov | ||
---|---|---|---|
Line 276: | Line 276: | ||
Only mutating methods can and must be called using the '' | Only mutating methods can and must be called using the '' | ||
+ | |||
+ | Similarly, classes trying to implement '' | ||
TOOD: Check if we can enforce '' | TOOD: Check if we can enforce '' | ||
Line 367: | Line 369: | ||
Inheritance is currently not allowed for structs. Structs are mainly targeted at data modelling, which should prefer composition over inheritance. There are currently no known technical issues with inheritance for structs, but we may want to be cautious when introducing them, and carefully consider the plethora of subtle semantic nuances. | Inheritance is currently not allowed for structs. Structs are mainly targeted at data modelling, which should prefer composition over inheritance. There are currently no known technical issues with inheritance for structs, but we may want to be cautious when introducing them, and carefully consider the plethora of subtle semantic nuances. | ||
- | Implementing interfaces is allowed, however. | + | Implementing interfaces is allowed, however. Interface methods may be '' |
===== Hashing ===== | ===== Hashing ===== | ||
Line 395: | Line 397: | ||
$moved = $value; | $moved = $value; | ||
$value = null; | $value = null; | ||
- | return $value; | + | return $moved; |
} | } | ||
Line 408: | Line 410: | ||
===== Performance ===== | ===== Performance ===== | ||
- | Because '' | + | Assignment to a property now needs to check whether |
===== Backwards incompatible changes ===== | ===== Backwards incompatible changes ===== | ||
- | '' | + | '' |
+ | |||
+ | There are no other backwards incompatible changes. | ||
===== Vote ===== | ===== Vote ===== |
rfc/structs-v2.1713889947.txt.gz · Last modified: 2024/04/23 16:32 by ilutov