3 ms·
This part is exremely confusing: https://tour.val-lang.dev/bindings#lifetime https://tour.val-lang.dev/bindings#lifetime Why a value declared with `let` has a l
by sesm 3y ago
This part is exremely confusing: https://tour.val-lang.dev/bindings#lifetime https://tour.val-lang.dev/bindings#lifetime
Why a value declared with `let` has a lifetime? Is it because they want to avoid copying objects and data structures?
- zupa-hu 3y agoTo avoid shared mutable state, you either need copy-on-write (hence shared but not mutable) or mutable but not shared. I understand this is the second approach.