data oriented programming
Data is immutable.
Data is explicit.
Data is long live than the program.
value semantics
copy-on-write
inout 引數
code:swift
func f(v: inout V) {
v.x += 1
}
var v: V = …
f(&v)
code:javascript
v = produce(v, v => {
v.x += 1;
});
mutating func
inout な self
code:swift
extention V {
mutationg func inc() {
self.x += 1
}
}
var v: V = …
v.inc()
computed property は inout