April 2020
Intermediate to advanced
344 pages
11h 13m
English
Custom type variants that don’t hold data—for example, the values True, False, and Nothing—always have the same memory location. They work the same way with lazy as strings and numbers do. (In contrast, values created with Just might not have the same memory locations, because Just holds data.)
Other values keep the same memory location when they are passed around. Table C.2 shows some ways to get a value with the same memory location as another value.
|
Operation yielding same memory location |
Examples |
|---|---|
| Assigning it to another constant | sameMemory = oldValue |
| Reading it from a record field | sameMemory = record.oldValue ... |
Read now
Unlock full access