Project

General

Profile

Actions

Feature #14680

closed

Adding +@ and -@ to hash and array

Added by kddnewton (Kevin Newton) almost 6 years ago. Updated about 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:86513]

Description

Since we have -@ and +@ for strings and it's very useful (and reads better than .freeze) I'd like to propose adding the same API to hash and array. Especially with constants, linters are always telling me to freeze them, and I'd like to be able to accomplish that with -@. I've attached the necessary code to make that happen.


Files

freeze.patch (3.86 KB) freeze.patch kddnewton (Kevin Newton), 04/11/2018 02:49 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0