4 ms·
It is very cumbersome to not having the 'copy' or equivalence so that a lot of functional languages have similar things: F#: let updated = { old with prop = ne
by namelosw 7y ago
It is very cumbersome to not having the 'copy' or equivalence so that a lot of functional languages have similar things:
F#: let updated = { old with prop = newValue }
Elixir: update = %{ old | prop: newValue }
Even JavaScript have similar stuff: const update = { ...old, prop: newValue }
- capableweb 7y agoClojure: (assoc old :key new-value) just a fn in the end