Actions
Feature #8906
closedFreeze Symbols
Feature #8906:
Freeze Symbols
Description
Now, Integer and Float objects are frozen objects.
How about to freeze Symbol objects, too?
I think Symbol is friend of Integer.
Current behavior:
p :foo.frozen? #=> false
:foo.instance_variable_set(:@foo, 1)
p :foo.instance_variable_get(:@foo) #=> 1
Background of this proposal:
Now, I'm working on "GC-able Symbols" feature.
Freezing symbols make this feature easier.
for example:
(1) set an instance variable @iv for symbol s
(2) collect s
(3) generate s
(4) what value of @iv for s returns?
Actions