My understanding of Erlang is you have
- all data structures are immutable
- some data structures are static e.g. records i.e. at compile time
- some data structures are dynamic e.g. maps i.e. at runtime
Given = that everything is copied including static data structures like maps
Question = why can't we change the record?
(Guess at) Answer = because the record is defined in the header macro which is changed by the pre-processor.
(Guess at) Incorrect answer = because the data structures has fixed memory size (it doesn't) and unlike C arrays it isn't in contiguous memory but rather a linked list?