Re:My Weird Ruby
by masklinn on Saturday March 07, 2015 @05:20AM
(#9161513)
> 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.
Re:My Weird Ruby
by kyllo on Saturday March 07, 2015 @01:30PM
(#9162571)
To 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.
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.