Project

General

Profile

Actions

Feature #8906

closed

Freeze Symbols

Added by ko1 (Koichi Sasada) over 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
[ruby-core:57179]

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?


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #8579: Frozen string syntaxClosed06/29/2013Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0