3 ms·
> ou can always freeze your hashes in Ruby for safety if you want to. All that's missing is some sugar for declaring immutable hash literals. And immutable str
by masklinn 12y ago
> ou can always freeze your hashes in Ruby for safety if you want to. All that's missing is some sugar for declaring immutable hash literals.
And immutable structures with efficient "updates". Because otherwise every time you're altering the structure you have to copy it in full (though shallowly) then mutate it in place.
- grandalf 12y agoWell you could use this: https://github.com/hamstergem/hamster https://github.com/hamstergem/hamster
- kyllo 12y agoTo go along with that--methods that have immutable/pure functional semantics, meaning they return a modified copy of the structure, with no side-effects, rather than mutating a shared object.